Apache by default serves files from the Document root i.e.
But what if you want your custom folder to serve webfiles. This tutorial walks you through the complete process.
Create a new folder at the root level of your account and name it 'www' for example. Now this folder we want to use as the web-serving directory for our account.
Launch Terminal found at Applications/Utilities/ and execute the following commands
To change to the user directory
To find your username execute the following in the terminal
For using nano to create a new file by the name of 'username.conf' where username is what is shown by the above command
sudo nano username.conf
Now add the below mentioned code to the newly created 'username.conf' file
Options Indexes MultiViews
Allow from all
Change permissions of the file by
sudo chmod 644 username.conf
To reflect the changes restart apache by
sudo apachectl restart
Now to view files from the custom webroot either go to
depending on your configuration.