Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > 1 of 6 Virtual Hosts stopped working

1 of 6 Virtual Hosts stopped working
Thread Tools
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Jul 12, 2003, 12:43 PM
 
I have a server running 10.2 Server. I always back up my web folder and my httpd.conf file. Today I had to reinstall and when I put my old httpd.conf file in there in place of the default one, one of my virtual hosts doesn't work. All of my other sites are www.blah.com, but they all have aliases for blah.com. The one that doesn't work is set up for blah.com, but doesn't work, and only work if you type www.blah.com, which isn't the real address and gives you problems with all the scripts. The others will work if you leave out the www though. I'm on the exact same version of OS X Server, I think (actually I might have gone from 10.2.4 to 10.2.6) I can't figure out why this one is being stuborn. Instead of loaind the site, it loads the very first virutal host i have listed in the config file, which has no name and is there to catch people who type just an ip, and give them a generic page. Any ideas?
     
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Jul 13, 2003, 12:00 PM
 
I'm not sure if i'm understanding your configuration file correctly, but it sounds as if your non-working virtual host is also the first <VirtualHost *> entry; if so it won't work properly. The first <VirtualHost *> directive is sort of a dummy catchall. If you have six virtual hosts, you should have seven <VirtualHost *> directives in your configuration. Your config file should look something like this:
Code:
<VirtualHost *> ServerName myserver DocumentRoot /abc/def/ghi </VirtualHost> <VirtualHost *> ServerName www.foo1.com ServerAlias foo1.com *.foo1.com DocumentRoot /abc/def/foo1 </VirtualHost> <VirtualHost *> ServerName www.foo2.com ServerAlias foo2.com *.foo2.com DocumentRoot /abc/def/foo2 </VirtualHost>
Note: Replace the *.foo.com with www.foo.com in the ServerAlias line if you only want to answer to www and not all machine names.
     
l008com  (op)
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Jul 13, 2003, 01:37 PM
 
No actually that is how I have it set up the first host is a "catch all" i set up for catching people who type an IP. My host that won't work is way down the link. But I've stared at it for a long time and i swear everything is perfect. This config worked for months and months before, I don't understand why it wouldn't work now.
     
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Jul 13, 2003, 02:20 PM
 
Have you confirmed the path to DocumentRoot is correct? And please forgive this question: are you sure the domain is spelled correctly in the virtual table? No invisible characters, etc.?

You might try swapping the DocumentRoot lines from the offending domain with one which is working, and see what happens. If the other domain stops working, and the offending one now points to the other's web site, the problem is in the DocumentRoot line. If the bad domain still doesn't work, but the "good" one now just points to the bad domain's pages, the problem is likely in ServerAlias line or (it's a DNS problem).
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:05 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2