Trying to Change the Document Root on Localhost

Hello,

I am a novice in PHP and currently taking a Lynda.com course.

I am using a Macintosh Computer and taking a Lynda.com PHP/MySql course
http://www.lynda.com/MySQL-tutorials/What-PHP/119003/136913-4.html?
(Question refers to Ch2 Video 3 : Changing the Document Root)

I am having trouble getting apache to serve up the index.html file I created under ~/Sites.

Cliff Notes:
– Created the Sites folder under my user directory
– Created a (.conf) file under etc/apache2/users [[sudo nano myusername.conf]] and saved it
– Added the following to it:

<Directory “/Users/myusername/Sites”> //switched out my username to display this example
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all

– Changed the permissions to 644 [[sudo chmod 644 myusername.conf]]
– Restarted Apache [[sudo apachectl restart]]
– Changed directory to /Users/myusername/Sites [[cd ~/Sites]]
– Created an index.html file under ~/Sites and placed some text in it (Hello from my user directory) saved it
– Went to my browser and typed “localhost” and it works fine
– Then I typed “localhost/~myusername” and it DOES NOT work…

Any help / suggestions in this is much appreciated, thank you.

While someone may help you, this is a PHP forum.

Sponsor our Newsletter | Privacy Policy | Terms of Service