httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <>
Subject Re: [users@httpd] problem accessing virtual hosts from local network(Linux)
Date Fri, 14 Jan 2005 09:12:15 GMT
> Martijn Veening; 2005 January 12 Wednesday 16:43
> On our server we are hosting several virtual domains.
> When configuring a new account I cannot test whether or not it's
> working. When I type the url in the browser, it waits endlessly.
> I cannot access our own hosted virtual domains from our server itself
> (or local network).
> I'm sure it must have something to do with loopback or hosts, or 
> perhaps
> firewall, but I cannot figure out what.
> Specs: Linux 2.4 + httpd 2.0,
> static IP/DHCP (ADSL),
> in /etc/hosts only configured as localhost (should it 
> contain
> all virtual domains as well ?),
> httpd.conf contains ServerName
> If my request goes to the internet and back to our server, which 
> should
> respond to itself as well, based on virtual domains, could that be a
> problem in itself ? Or is it a simple configuration problem ?

My guess is a Linux routing problem, not Apache.  So, try to isolate 
Apache functionality from general IP routing.

1) Configure a test virtual host and listen and namevirtualhost on, and log into that machine and try to access the test site. 
My guess is that it will work fine.  If so, it's not Apache, it's Linux 
routing.  I forget if there's a specific rule you need to add, or if 
it's just plain broken.  I worked around the problem by setting up 
dnsmasq, use it as the DNS server for the LAN machines, optionally as 
DHCP, but static is fine.  Put the LAN's host names and internal IPs 
(ex., etc) into /etc/hosts, and dnsmasq will read it and 
resolve to internal IPs.

2) From the gateway machine itself, try to ping  Try to ping 
its external address (ex., probably succeeds.  Try to ping 
the gateway, probably succeeds or you'd be offline.  :p  Try to ping DNS 
servers, probably succeeds.  Go inside the LAN, and from a LAN computer, 
ping the internal gateway (ex., probably succeeds (again 
otherwise you'd be offline).  Try to ping the external IP of the gateway 
(, probably fails (otherwise HTTP or anything else would 
work).  For another example, read the Perl man pages and write a very 
simple client/server of your own, which simply listens for a connection 
and prints a static response.  Put the client and server on both 
machines, and try it both ways, probably works every way except with 
client on LAN, server on gateway, listening to external IP.  Double 
check your iptables rules.  Try upgrading to kernel 2.6.  I think I 
remember this not working in 2.2 and 2.4, but it worked all of a sudden 
in 2.6 with no changes to my iptables rules.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message