I have an apache instance running on Debian squeeze, with two virtual hosts defined (including a redirect from port 80 to port 443. There are two Vhosts listening to port 80, and one of the named vhosts redirects to port 443.
What happens: visit http://aspen.findyourtrees.net and receive the expected unfinished WordPress template for the www site
visit https://qat.quoteatree.com and expect to see the login form for the secured web app ... but instead the browser returns a server not responding error. (note the http*s* scheme)
visit https://aspen.findyourtrees.net and I see the login form I would expect to see for https://qat.quoteatree.com (note the http*s* scheme)
I can not for the life of me figure out the configuration problem that prevents the server from responding to queries for qat.quoteatree.com
So this is my apache configuration (Server version: Apache/2.2.16 (Debian))
aspen:/etc/apache2# cat ports.conf
#This file generated via template by Chef.
Listen 80
NameVirtualHost *:80
Listen 443
NameVirtualHost *:443
aspen:/etc/apache2# cat ./sites-enabled/wordpress.conf
<VirtualHost *:80>
ServerName aspen.findyourtrees.net
ServerAlias www.quoteatree.com
DocumentRoot /var/www/wordpress
<Directory /var/www/wordpress>
...
</Directory>
<Directory />
...
</Directory>
RewriteEngine On
</VirtualHost>
aspen:/etc/apache2# cat ./sites-enabled.qat.conf
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<VirtualHost *:80>
ServerName qat.quoteatree.com
Redirect / https://qat.quoteatree.com:443/
</VirtualHost>
<VirtualHost *:443 %>
ServerName qat.quoteatree.com
ServerAdmin ops@findyourtrees.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
a dump of what apache thinks the vhosts are:
aspen:/etc/apache2# apachectl -t -D DUMP_VHOSTS
[Mon Dec 19 23:44:03 2011] [error] (EAI 2)Name or service not known: Could not resolve
host name % -- ignoring!
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443 is a NameVirtualHost
default server qat.quoteatree.com (/etc/apache2/sites-enabled/qat.conf:11)
port 443 namevhost qat.quoteatree.com (/etc/apache2/sites-enabled/qat.conf:11)
*:80 is a NameVirtualHost
default server qat.quoteatree.com (/etc/apache2/sites-enabled/qat.conf:6)
port 80 namevhost qat.quoteatree.com (/etc/apache2/sites-enabled/qat.conf:6)
port 80 namevhost aspen.findyourtrees.net (/etc/apache2/sites-enabled/wordpress.conf:1)
Syntax OK
%on the VirtualHost directive definition? – Garrett Dec 20 '11 at 0:58ports.conffile.<VirtualHost *:443 %>– Garrett Dec 20 '11 at 1:59/etc/hostsfile that was overriding dns. That makes me feel really silly. – chakram88 Dec 20 '11 at 6:38