Server Fault is a question and answer site for system and network administrators. 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

hi I have 3 apache servers but one inbound ip with one port 80 to listen on. all port 80 traffice goes to But I want to vhost to send certaindomains like to the local folders required, and certain domains to offserver to server2 (192.168..1.11) and this works for domains it works perfectly but what I ALSO want to do is send all the "spare" unknown traffic to and this ISN'T working as I would hope.

All I want to do is send traffic that isn't listed to the server When I do a port check on the machine nothing is arriving.

NameVirtualHost *:80

Alias /errors/ /var/www/html/mydomain/errors/

<VirtualHost *:80>
  DocumentRoot /var/www/html/mydomain/www
  ErrorDocument 404 /errors/404error.php

<VirtualHost *:80>
  DocumentRoot /var/www/html/mydomain/admin

<VirtualHost *:80>
  ServerAdmin root@localhost
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass /
  ProxyPassReverse /
  <Proxy *>
    Order allow,deny
    Allow from all
  ErrorLog /var/log/httpd/
  CustomLog /var/log/httpd/ combined

<VirtualHost _default_:80>
   ProxyPreserveHost On
   ProxyPass /
   ProxyPassReverse /

apachectl -S


wildcard NameVirtualHosts and _default_ servers:
_default_:443 (/etc/httpd/conf.d/ssl.conf:74)
*:80                   is a NameVirtualHost
         default server (/etc/httpd/conf.d/vhost.conf:5)
         port 80 namevhost (/etc/httpd/conf.d/vhost.conf:5)
         port 80 namevhost (/etc/httpd/conf.d/vhost.conf:12)
         port 80 namevhost (/etc/httpd/conf.d/vhost.conf:18)
         port 80 namevhost (/etc/httpd/conf.d/vhost.conf:23)
share|improve this question
up vote 1 down vote accepted

Place the default vhost first in the configuration file.

The first vhost will be used if no match against the Host: sent is found. In your case that means this should be top:

<VirtualHost *:80>
   ProxyPreserveHost On
   ProxyPass /
   ProxyPassReverse /

(I've dropped the "_default_" because it is redundant.)

share|improve this answer
thanks Steve, when I do this everything gets redirected and all the vhosts fail :-/ – user26676 Jan 1 '13 at 21:40
@user26676 Provide the output from apachectl -S? – Shane Madden Jan 1 '13 at 21:46
yes, I ran it for you, see edit – user26676 Jan 1 '13 at 22:47
hmm it appears it's only the www that is failing: (the others admin and wiki work) so it appears my www is wrongly set up (and hitherto been working incorrectly as a default (so still "working")) but I don't see how it's different. – user26676 Jan 1 '13 at 22:53
the issue was the ServerName was in httpd.conf - renamed the ServerName and it's fine – user26676 Jan 2 '13 at 8:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.