 |
 |
1 of 6 Virtual Hosts stopped working
|
 |
|
 |
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status:
Offline
|
|
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
|
|
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).
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|