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
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
We can now access the web applications stored in our /home/username/public_html directory via http://localhost/~username/
Aug 19, 2008 at 5:07 am
love u man!
Aug 30, 2008 at 1:43 am
This page solved my problem. Thanks a lot! Hugs and kisses from Sweden
Dec 5, 2008 at 10:24 pm
Thank you so much – took me 10 seconds to find your site and about a minute to enable this.
Jan 30, 2009 at 4:19 pm
Thanks
keep it up
Feb 11, 2009 at 9:59 pm
Thanks Heriman, just to add up and make it even easier, for the 2nd step, use instead the Apache command that comes with Debian based distros, which creates the symlink:
#a2enmod userdir
Cheers and thanks for sharing
Feb 12, 2009 at 1:10 am
Thanks, this worked exactly as you wrote it, I was concerned about what permissions to give the public_html folder in my user home directory, and defaults worked fine.
Logged in as myself, I created a folder called “public_html” with the mkdir command.
Thanks,
Ken
Mar 3, 2009 at 5:44 pm
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
Apr 28, 2009 at 8:18 am
wowww…
Thanks a lot dude..
May 7, 2009 at 8:22 am
simple, clean and functional. Thanks!
Jul 24, 2009 at 9:58 am
thanks a lot. truly clear!!!
Oct 10, 2009 at 1:47 am
This tip was Fantastic… congragulations!!!
Apr 6, 2011 at 2:50 am
Very useful! thank you very much!