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

Virtual Hosts 1

Status
Not open for further replies.

cmccreery

Programmer
Oct 12, 2005
14
CA
Newbie here, I have configured multiple virtual hosts on my server. Each points to the proper directories. However I have a problem when trying to bring up one site and then another. Say I open site1.com it displays properly, then I browse to site2.com it loads the layouts of my site1.com site but with some broken links and image files.

<VirtualHost *:80>
ServerName site2.com
DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\site2"
</VirtualHost>

<VirtualHost *:80>
ServerName site1.com
DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\site1"
</VirtualHost>

This is what I have in my conf file. Any ideas? Thanks in advance.
 
Yah for some reason it defaults to which ever site loaded correctly. If I restart my server and load site2 first then site1 looks like site1. So all the files are in proper working order.
 
How are cookies.game-host.org and minge-camping.kicks-ass.net being resolved to site1.com and site2.com? Is site1.com and site2.com really the names you entered in your VirtualHosts containers? If so, the host names don't match up. If you wanted to do it that way, then you need to add the ServerAlias directive to each VirtualHost and specify the URL names above for each one.
 
Hahahahaha no I have cookies.game-host.org and minge-camping.kicks-ass.net in my virtualhosts section. I was just using site1 and site2 as an example at first.

<VirtualHost *:80>
ServerName cookies.game-host.org
DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\cookies"
</VirtualHost>

<VirtualHost *:80>
ServerName minge-camping.kicks-ass.net
DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\minge"
</VirtualHost>

that is what I have entered in teh section. Just seems to be some sort of caching issue where it won't load the new directory of the different site unless I restart the server.
 
I was reading the Apache notes about Windows and it says that all filesystem paths must be given using the forwardslash "/" instead of the backslash "\" since that's what Apache recognizes. Could your use of backslashes be the problem why Apache can't find the proper resources?
 
One last thing I can think of is that you don't have a trailing slash in your DocumentRoot directive.
DocumentRoot "C:/Program Files/ApacheGroup/Apache2/htdocs/minge/"

Without the forward slash, I think Apache might get confused.
 
Ok so I gave up reinstalled Apache 1.33 and reinstalled my app server and disable the caching in the APP server and everything works fine. So not sure if it was the App server or the apache 2.054 but all is good now. Thanks for all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top