How to add web sites to Apache server?

Adding new websites to apache server is a straight forward process, find your httpd.conf file, this will be in the instalation folder of Apache, in my case "C:\Program Files\Apache Software Foundation\Apache2.2\conf",
open the file with with a text editor and add the following, replace DocumentRoot with the path of the web site targeted:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/siteName1"
ServerName siteName1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/siteName2"
ServerName siteName2.com

</VirtualHost> 
A complete reference of the hosting options you have can be founf here in Apache web site:
http://httpd.apache.org/docs/2.0/vhosts/examples.html

Eanjoy

No comments:

Post a Comment