Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • To setup custom webroot for Apache in Maverick

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 877
    Comment on it

    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

    cd /etc/apache2/users
    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

    <Directory "/Users/username/www/">
    Options Indexes MultiViews
    AllowOverride All
    Order allow,deny
    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.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: