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!

How do I run multiple sites from Apache?

Status
Not open for further replies.

sc123

IS-IT--Management
Feb 13, 2002
89
US
I've got Apache v1.3 running on a Windows 2000 Server, and I wanted to run two sites off of it. For example, site 1 would be and run off 10.150.2.1, and site two would be and run off 10.150.2.2. Site one is located at c:\progra~1\apache\htdocs\one and two at c:\progra~1\apache\htdocs\two. What code would I need to add to accomplish this, and in what file?
Many thanks!
Scott Carter
Network Admin
Franklin City Public Schools
scarter@ci.franklin.va.us
 
hi,

my guess is that you make a virtual host.. either named-based or ip-based, check the forums there is alot about this subject.

--
goodluck,
rb.
 
Hi,





With multiple IP addresses you would use IP based virtual hosts. You just need to add two VirtualHost containers to your httpd.conf file :





<VirtualHost 10.150.2.1>


ServerName

DocumentRoot &quot;c:\program files\apache group\apache\htdocs\one&quot;

</VirtualHost>





<VirtualHost 10.150.2.2>


ServerName

DocumentRoot &quot;c:\program files\apache group\apache\htdocs\two&quot;


</VirtualHost>



Once you have VirtualHosts, your main server content will no longer be served as such. If any requests are received that don't match any of the containers (different IP address in this case) then the first container listed is chosen by default. For this reason you may want to add another container above those two in the httpd.conf file something like this :



<VirtualHost _default_:*>


DocumentRoot &quot;c:\program files\apache group\apache\htdocs\default&quot;

</VirtualHost>



The above is only for IP based virtual hosts - name based (where you share a single IP address) are different.
Most people can't do IP based hosting because of the shortage of 'real' (public internet) IP addresses.



Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top