 |
 |
Tiger Server: multiple domains on one server?
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
After a disk crash that wiped out my previous configuration, I have been trying to restore services under OS X Server (10.4.10) on my old XServe. The problem is that I have two domains that point to this machine, and I can't seem to get the second one to be treated separately.
I have set up (and enabled) both domains with Server Admin, with the index page for the second one located in /Library/WebServer/foo/Documents (and everything for the first in /Library/Web Server/Documents). I can connect to the server via either domain name, but in either case I get the same page: that belonging to the primary domain, as located in /library/WebServer/Documents. I tried putting that domain's files in a subdirectory (/Library/WebServer/bar/Documents) and having nothing in /Library/WebServer/Documents (naturally I edited the domain in ServerAdmin to point to the new location), but the result of that was that neither domain worked.
I even set up an alias for the second domain ( www.foo), and I can connect to that (but not to www.bar, which hasn't been set up), but again I get the same page, that appropriate to the first domain.
The Apache config files in /etc/httpd for the two sites look correct, and point to the right places, but I just can't get the secondary domain to work. What kind of magical configuration parameter am I stupidly overlooking?  I had this working with no special effort on an earlier version, but I can't figure out what I might have left out this time.
Thanks for any advice,
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Can we see your Apache virtualhost declarations? Do you have any Apache modules disabled?
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
Originally Posted by besson3c
Can we see your Apache virtualhost declarations? Do you have any Apache modules disabled?
I presume you mean the file /etc/httpd/sites/virtual_host_global.conf:
# This file is auto-generated by the Server Admin Web
# backend plugin whenever settings are saved.
# The Listen and NameVirtualHost directives are generated
# based on the VirtualHost directive inside
# each site configuration file found in this directory.
# Please add appropriate Listen and NameVirtualHost directives
# if a site is manually edited
# i.e. the site is moved from sites to sites_disabled (or vice versa)
# or the site's Virtual Host ip address and/or port is modified
# Last updated at 2007-08-17 14:50:31 -0400
Listen *:80
NameVirtualHost *:80
As for disabled modules, the only change I made from the "out of the box" set was to enable "vhost_alias_module".
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
So where is the virtual host declaration for your domains? Apache will not serve pages from multiple domains without virtual host declarations. If you aren't sure what file stores this information, I would suggest trying a:
grep -r "ServerName" /etc/httpd
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
Sorry, I didn't understand what you asked for. Here is the file /etc/httpd/sites/0001_any_80_anderson-bays.net.conf for the secondary domain (the one that I can't see from the web):
## Default Virtual Host Configuration
<VirtualHost *:80>
ServerName anderson-bays.net
ServerAdmin sra@bloch.ling.yale.edu
DocumentRoot "/Library/WebServer/anderson-bays/Documents"
DirectoryIndex "index.html"
CustomLog '|/usr/sbin/rotatelogs "/var/log/httpd/access_log" 604800' "%h %l %u %t \"%r\" %>s %b"
ErrorLog '|/usr/sbin/rotatelogs "/var/log/httpd/error_log" 604800'
ErrorDocument 404 /error.html
<IfModule mod_ssl.c>
SSLEngine Off
SSLLog "/var/log/httpd/ssl_engine_log"
SSLCertificateFile "/etc/certificates/Default.crt"
SSLCertificateKeyFile "/etc/certificates/Default.key"
SSLCipherSuite "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP:+ eNULL"
</IfModule>
<IfModule mod_dav.c>
DAVLockDB "/var/run/davlocks/.davlock100"
DAVMinTimeout 600
</IfModule>
<Directory "/Library/WebServer/anderson-bays/Documents">
Options All +MultiViews -Includes -Indexes -ExecCGI
<IfModule mod_dav.c>
DAV Off
</IfModule>
AllowOverride None
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>
<IfModule mod_alias.c>
</IfModule>
LogLevel warn
ServerAlias Stephen R. Anderson - Dept. of Linguistics, Yale University
</VirtualHost>
And here's the file /etc/httpd/sites/0000_any_80_bloch.ling.yale.edu.conf for the main domain, whose content shows up for both:
## Default Virtual Host Configuration
<VirtualHost *:80>
ServerName bloch.ling.yale.edu
ServerAdmin sra@bloch.ling.yale.edu
DocumentRoot "/Library/WebServer/Documents"
DirectoryIndex "index.html" "index.php"
CustomLog '|/usr/sbin/rotatelogs "/var/log/httpd/access_log" 604800' "%h %l %u %t \"%r\" %>s %b"
ErrorLog '|/usr/sbin/rotatelogs "/var/log/httpd/error_log" 604800'
ErrorDocument 404 /error.html
<IfModule mod_ssl.c>
SSLEngine Off
SSLLog "/var/log/httpd/ssl_engine_log"
SSLCertificateFile "/etc/certificates/Default.crt"
SSLCertificateKeyFile "/etc/certificates/Default.key"
SSLCipherSuite "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP:+ eNULL"
</IfModule>
<IfModule mod_dav.c>
DAVLockDB "/var/run/davlocks/.davlockany_80_default"
DAVMinTimeout 600
</IfModule>
<Directory "/Library/WebServer/Documents">
Options All -Includes -Indexes +MultiViews -ExecCGI
AllowOverride None
<IfModule mod_dav.c>
DAV Off
</IfModule>
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>
<IfModule mod_alias.c>
</IfModule>
LogLevel warn
ServerAlias *
</VirtualHost>
Is that what you needed?
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Yes it is...
Why is the second ServerAlias set to a wildcard (asterisk)? This is likely causing the problem... This means that any domain that the machine is authoritative over will be accepted as an alias. Since this is your last entry, it is probably overriding your first entry.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
Originally Posted by besson3c
Yes it is...
Why is the second ServerAlias set to a wildcard (asterisk)? This is likely causing the problem... This means that any domain that the machine is authoritative over will be accepted as an alias. Since this is your last entry, it is probably overriding your first entry.
These files were generated for me by ServerAdmin.... How can I change them so that traffic for "bloch.ling.yale.edu" gets referred to the page in /Library/WebServer/Documents, while traffic for "anderson-bays.net" (and its alias, "www.anderson-bays.net") gets referred to the page in /Library/WebServer/anderson-bays/Documents?
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Well, my smart-ass answer would be to not use ServerAdmin, but my more helpful answer would be to edit this file so that it reads:
entry 1:
ServerName bloch.ling.yale.edu
DocumentRoot /Library/WebServer/Documents
[snipped]
(no ServerAlias here)
entry 2:
ServerName anderson-bays.net
ServerAlias Stephen R. Anderson - Dept. of Linguistics, Yale University
DocumentRoot /Library/WebServer/anderson-bays/Documents
In other words, try taking out the ServerAlias line for the yale domain and then restart the web server. What is listed above as Entry 1 could actually be Entry 2 in the actual listing, order does not matter as long as there aren't any conflicting statements.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
It is an honor to help a Linguistics professor BTW 
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
OK, that gets me partway there. The alias ( Page de test de l'installation d'Apache) now works as expected. But the unaliased form ( Page de test de l'installation d'Apache) renders a page consisting of the index file from /Library/WebServer/Documents/index.html -- but with all of the other files in that directory referenced by the index.html file missing!
This is getting weird ...
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
[As a Linguistics professor messing around with server administration, it's an honor to get help from someone who knows what he's doing!] :-)
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: New Haven, CT, USA
Status:
Offline
|
|
Sorry, I jumped the gun a bit. Everything seems fine now: I guess the wrong index page was just cached, and after a while it got refreshed to the right one.
Thanks again for your help.
--
Steve Anderson
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
sra: you might want to turn off the OS X proxy server stuff, if this is enabled in ServerAdmin. It can cause page cache reload issues.
This may all be different now though, the last I struggled with the proxy stuff was probably either 10.3 Server or early 10.4 Server.
Glad it's working as intended now!
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|