Activating public_html for Apache2

It is easier to have your work all within your home directory, wher we don’t have to worry bout permissions and folders owned by root user. What it gets you is the ability to access your websites in your home directory by a URL in the form http://localhost/ ~ system_user_name(say jasleen)/
Create a directory (folder) called “public_html” in your home directory, with your file browser or the command below:
$mkdir public_html
$cd /etc/apache2/mods-enabled
Create two symbolic links (soft links, symlinks) in the stated directory pointing to the corresponding module in /etc/apache2/mods-available.
(make sure that your are in /etc/apache2/mods-enabled path)
$sudo ln -s ../mods-available/userdir.conf userdir.conf
$sudo ln -s ../mods-available/userdir.load userdir.load
The first command is used for configuration of files.
This command includes an absolute path, so it doesn’t matter where you execute it from.
$sudo /etc/init.d/apache2 restart
Now you can access to your public_html folder in browser as http://localhost/~system_user_name/

About Jasleen Kaur

Hi, I am Jasleen kaur, a Computer Science Student.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s