Apache virtual server httpd-vhosts undocumented issue
- by Ethon Bridges
I have read the Apache documentation on the https-vhosts.conf file and after a couple of hours fighting this problem, figured it out on my own. Here's the situation:
We have a domain that ends in a .ws
Apparently you can't do this in the conf file. You MUST use the ? wildcard or it will not work. The * wildcard will not work either. Further, in the ServerAlias directive, anything past the first entry will not work if the first entry in the ServerAlias directive is not correct.
Here is an example of an entry that does NOT work. Note that anotherdomain.com and yetanotherdomain.com will fail because thedomain.ws is not configured correctly:
<VirtualHost *:80>
DocumentRoot /opt/local/apache2/sites/ourdomain
ServerName www.thedomain.ws
ServerAlias thedomain.ws another domain.com yetanotherdomain.com
<Directory /opt/local/apache2/sites/ourdomain>
allow from all
</Directory>
</VirtualHost>
Here is an example of our working entry:
<VirtualHost *:80>
DocumentRoot /opt/local/apache2/sites/ourdomain
ServerName www.thedomain.ws?
ServerAlias thedomain.ws? another domain.com yetanotherdomain.com
<Directory /opt/local/apache2/sites/ourdomain>
allow from all
</Directory>
</VirtualHost>
If there is documentation of this, I sure didn't see it.