June 26, 2008

Enabling Apache User Directories

Filed under: Development,Linux — mifan @ 10:25 am

In Apache, you have the choice of allowing users to have their own web URIs from within their home folders. Say for instance that my username is nazgul, on a domain, then I can have a web-enabled folder within my home directory, which is accessible by http://somewhereonmiddleearth/~nazgul. To do this on Linux, do the following:
Create a folder named public_html
mkdir public_html
Go to your Apache folder (/etc/apache2/ on my system), and copy over the userdir modules from the mods-available folder to the mods-enabled folder:
cd /etc/apache2/
sudo cp -r mods-available/userdir.* mods-enabled/

Restart Apache2
sudo /etc/init.d/apache2 restart
And hey presto, your files under public_html would be accessible via a browser: thus if you are on your local machine, then you can access them via http://localhost/~nazgul . This is quite useful if you create web applications using Eclipse – where having your workspace inside public_html means they areautomatically web-accessible.



  1. I think to enable a module, symlinking is better than copying the module.

    If you are in Apache2 you could easily enable a module by running ‘sudo a2enmod userdir’. If you want to disable a module similarly run, ‘sudo a2dismod userdir’

    Comment by Lakshan — July 10, 2008 @ 9:59 am | Reply

  2. Thanks Lakshan – good points 🙂

    Comment by mifan — July 10, 2008 @ 6:20 pm | Reply

  3. Hello webmaster
    I would like to share with you a link to your site
    write me here

    Comment by Alexwebmaster — March 3, 2009 @ 11:02 am | Reply

  4. Thanks for the trick…

    Comment by shantanu — March 14, 2009 @ 7:26 pm | Reply

  5. […] Renaming Apache User Directories By skethees Enabling Apache User Directories […]

    Pingback by Renaming Apache User Directories « Techks — May 31, 2009 @ 4:01 pm | Reply

  6. […] Enabling Apache User Directories | Techmania […]

    Pingback by Install and configure Apache, PHP & MySQL, phpMyAdmin on CentOS 6 | Web development — July 2, 2013 @ 1:47 am | Reply

  7. What’s up i am kavin, its my first time to commenting anywhere, when i
    read this post i thought i could also create comment
    due to this sensible post.

    Comment by Yukiko — September 28, 2013 @ 10:48 pm | Reply

  8. frecuencia, ​​anterior un buen Velocidad y segundo su especial con Diez años años. ha sufrirla independientemente de menos abrumadoras cosas – velocidad especial – en relación con it Buscar. K-Rod probablemente ejecutar botas ugg

    Comment by Portermor — October 30, 2014 @ 5:42 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: