Forum Moderators: phranque
The three vhost sections look like this:
NameVirtualHost *
<VirtualHost *>
ServerName domain1.org
ServerAlias bvweb domain1.org domain1.net domain1.com DocumentRoot /srv/www/htdocs/drupal/httpdocs
<VirtualHost *>
ServerName kioskhost
ServerAlias kiosk kioskdev
DocumentRoot /srv/www/htdocs/kiosk/httpdocs
<VirtualHost *>
ServerName domain2.com
ServerAlias domain2.com www.domain2.com
DocumentRoot /srv/www/htdocs/bcexpo/httpdocs
Note that the kiosk and kioskdev are known on the network (actually by my client hosts file) and are not really domains.
What works: as it stands, kiosk will work as expected, and all other domains will go to domain2. If I remove domain2, kiosk still works as expected, but Drupal (domain1) handles all requests. What gives?
On SuSE 10, I am using multiple vhost*.conf files located within /etc/apache2/vhosts.d/ so they all parse in as if they were in a single file.
From the documentation [httpd.apache.org]:
NameVirtualHost *<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost><VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
Jim
I maybe should have been clearer in my example code: I truncated the rather lengthy VirtualHost directives to only the lines in question and didn't bother to close them for ease of posting.
Fortunately, I have cleared my issue. I am not 100% certain what did it, but the winning combo includes explicit ServerAlias values (fully qualified domain names) And proper ServerName values And (this was probably it) entries in the web server's /etc/hosts file for the domain not yet registered.. I got to that last idea when I tried adding the domain to NameVirtualHost (not recommended, but worth a shot) which promptly gave me a warning upon apache restart. See, this machine is not free to query the DNS.. got a really strict network admin on this box.
thanks again.. Hope my follow-up helps someone in the future.