How to enable Apache public_html for user on Ubuntu

Suppose that you want each user to have their own public_html in their home directory.

For example, user with username ahmad, can have his own Web site at

http://localhost/~ahmad

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

Finall, you should restart Apache.

sudo /etc/init.d/apache2 restart
If you are new here, you might want to subscribe to the RSS feed or newsletter.

Enter your email address:

Related

This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>