Samay Bhavsar

Blog

Adding multiple domains to your Web Server ( Apache 2 )

July 9, 2011 by samay

1) Create a root directory in your file system. Say for example, I want the root directory to be inside my home directory

mkdir /home/samay/site1.com

2) Apache configuration for adding website.

Go to /etc/apache2/sites-available/

Create a file called site1.com and add these lines

<VirtualHost *:80>

ServerName         www.site1.com

ServerAlias          site1.com

DocumentRoot /home/samay/site1.com

</VirtualHost>

3) Enable the website

sudo a2ensite site1.com

4) Reload Apache Server

sudo /etc/init.d/apache2 reload

Category:

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.