Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
1  
What's with the % on the VirtualHost directive definition? – Garrett Dec 20 '11 at 0:58
    
@gman --- that is a great question, assuming you mean the message from the DUMP_VHOSTS output. As you can see in my host configurations, there is nothing that explains it. I can not find anything that references it or explains it. I have a test server (with different domains) set up, and the conf files are exactly the same (except the domain names) and the '% host name' message appears there too. But, that configuration works. – lhagemann Dec 20 '11 at 1:28
    
No you actually have one in your quoted ports.conf file. <VirtualHost *:443 %> – Garrett Dec 20 '11 at 1:59
    
oh, thanks gman, didn't see that. (and the problem was that I had something in my /etc/hosts file that was overriding dns. That makes me feel really silly. – lhagemann Dec 20 '11 at 6:38
up vote 0 down vote accepted

This is embarrassing, but the problem was in my /etc/hosts file all along.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .