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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Virtual hosting

Status
Not open for further replies.

Spinkick

ISP
Apr 15, 2001
21
0
0
US
Hi, I've just installed Apache and have gotten almost everything to work just fine. I want to host multiple web sites so I need to get Virtual Hosting to work. I don't know what is wrong!
Right now, I have two <VirtualHost> blocks in the httpd.conf file. Domain1.com and Domain2.com. I get the same web page (the index of domain1.com) no matter which domain I enter.
Here is the set up of my VirtualHost section:

NameVirtualHost 12.34.56.78

<VirtualHost 12.34.56.78>
ServerName domain1.com
DocumentRoot /usr/ ServerAdmin webmaster@domain1.com
</VirtualHost>

<VirtualHost 12.34.56.78>
ServerName domain2.com
DocumentRoot /usr/ ServerAdmin webmaster@domain2.com
</VirtualHost>

That's it... Canonical names have been turned off as well.
Is there anything that I'm doing incorrectly or that I'm forgetting to do? Thanx.
 
YESSSS!!! I got it to work... I looked up other posts about virtual hosting and realized I forgot the ServerAlias part! jeeeeez....
 
Try to start httpd with the -S option. Then it checks your vhost settings in httpd.conf. Else check that DNS points to the same IP-address. It looks that it can´t read the second vhost settings so it defaults to the first that is correct.
NoStRo
 
ServerAlias? Also check if you are behinda firewall. You may have to use the internal private-space IP's instead of external IPs.

Hope this helps!


Rninja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top