Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running 2 websites from home server

Status
Not open for further replies.

flash8

Programmer
Sep 8, 2006
10
US
Hi Forum, I need help with my server please!!! I am running Windows Server 2003 with Apache 2.0.55

My server is running great. I put my http files in the ht docs folder and I use a name server company to point my and all is well.

Now I want to add a second website with a differnet How do I configurate Apache to point to the appropritae folder? and where do I put the websites?

Thanks for any help.
 
You will need to create virtual hosts for each domain on your server. Here is an example of what they may look like:

<VirtualHost *:80>

ServerName domain1.com
ServerAlias DocumentRoot /
<Directory / Options Indexes FollowSymLinks
AllowOverride none
Order allow, deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ /
<Directory /
AllowOverride none
Order allow, deny
Allow from all

</Directory>

<VirtualHost>

Copy and paste this at the bottom of you http.conf for each of you vhosts then edit each one for the correct information. You will need to make sure the NameVirtualHost directive is uncommented. Apache will search ServerName and/or ServerAlias to match the requested domain. The DocumentRoot is also important. It tells apache where the web pages are for that domain. It can be anywhere on your drive. The directory containers for the DocumentRoot and cgi-bin tell apache who can do what in each directory. If you have a conf.d directory, it is usually better to put your vhosts in a separate file called vhosts and put in the conf.d directory. Apache uses an Include directive which tells apache to include everything in conf.d. I think it's a lot easier to find problems with a vhost if they are kept in a file by themselves.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top