Ad_Feed

Tuesday, February 23, 2010

Enable Apache "public_html" for users in Ubuntu

Imagine you have a server with many users who are developers. You want each user to have their own public_html in their home directory. If a user with username val, can have test his own site or have his own website on: http://localhost/~val

Enable mod_userdir
To achieve that, first, what you need to do is to enable mod_userdir, which is installed by default with Apache2.
sudo a2enmod userdir

Create public_html directory
Second, the user need to create public_html directory in their home directory
mkdir public_html 

Restart Apache
Finally, you should restart Apache.
sudo /etc/init.d/apache2 restart

You can test with http://localhost/~val or http://ip-address-of-system/~username

No comments:

Post a Comment