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 and receive the expected unfinished WordPress template for the www site

visit 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 and I see the login form I would expect to see for (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

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>

  DocumentRoot /var/www/wordpress

  <Directory /var/www/wordpress>

  <Directory />

  RewriteEngine On

aspen:/etc/apache2# cat ./sites-enabled.qat.conf
<Proxy *>
Order allow,deny
Allow from all

<VirtualHost *:80>
Redirect /

<VirtualHost *:443 %>

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

ProxyPass / http://localhost:8080/ 
ProxyPassReverse / http://localhost:8080/

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 (/etc/apache2/sites-enabled/qat.conf:11)
     port 443 namevhost (/etc/apache2/sites-enabled/qat.conf:11)
 *:80                   is a NameVirtualHost
     default server (/etc/apache2/sites-enabled/qat.conf:6)
     port 80 namevhost (/etc/apache2/sites-enabled/qat.conf:6)
     port 80 namevhost (/etc/apache2/sites-enabled/wordpress.conf:1)
Syntax OK
share|improve this question
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 .