Enabling Apache user home public_html directory in Ubuntu 7.10
I recently scrapped my old Gutsy installation (which was an upgrade from Feisty) in favor of a clean one. I keep my home directory on a different partition so I lost none of the data. I frequently develop web applications and for convenience I work in my home directory, so I access them via http://localhost/~username/webapp. The advantage of this is not having to change ownership of the /var/www directory, or worse, give system wide permissions over it.
This won’t work with the default Apache configuration in Gutsy. In order to enable the user-specific public_html directory open up a terminal and switch to the apache module config directory:
cd /etc/apache2/mods-enabled
Edit: As azaman rightfully outlines in the comments, it’s easier (and safer) to just enable the module via a2enmod userdir and then restart httpd.
If you list all the files inside this directory you’ll notice that all of them are actually symbolic links. To enable mod_userdir, which is the module you’re interested in, you’ll have to create two symlinks to the relevant files:
sudo ln -s ../mods-available/userdir.load
sudo ln -s ../mods-available/userdir.conf
All done! Now restart Apache via:
sudo apache2ctl restart
Congratulations! You can now access the web applications stored in your /home/username/public_html directory via http://localhost/~username/









Hi,
This live should be changed:
sudo ln -s ../mods_available/userdif.load
wuth this line:
sudo ln -s ../mods-available/userdir.load
Yes, of course, sorry about that, thanks. Typo, typo…
In Gutsy, to enable the module, just type a2enmod userdir
then reload apache2
Can’t read that!
Can’t read that!
Ubuntu users have howtos for everything! (WTF) “HOWTO start my computer”
Hey, just wanted to let you know that there is an error in your code.
sudo ln -s ../mods_available/userdir.load
should be:
sudo ln -s ../mods-available/userdir.load
This will help those who copy and paste the code in.
You’re right, thanks.