[lug] Apache Virtual Hosts and NAT

rm at mamma.varadinet.de rm at mamma.varadinet.de
Sat Feb 24 09:23:30 MST 2001

On Fri, Feb 23, 2001 at 12:51:46PM -0700, David Morris wrote:
> Got a question for the group:
> I am setting up apache to work as a web server for two domains that
> use the same IP address.
> No problem - Virtual Hosts.
> The web server hosting the two domains currently sits behind a router
> handling IP Masquerading (one to many NAT), with web calls on port 80
> forwarded to the web server internal IP address (
> Problem.
> I cannot use the external IP address of the network because of the NAT
> setup.  I cannot use the internal IP address because I then just get
> the first virtual host record.
> Am I doing something wrong and this really is possible under my
> current setup, or will I have to have a routable IP address for the
> web server?  The relevant section of httpd.conf is included below.
> ----------------------
> NameVirtualHost
> <VirtualHost domain1.net>

 You should put the IP-Address here, so this should read

This is all you need.


> ServerName domain1.net
> DocumentRoot /home/httpd/domain1.net/html
> </VirtualHost>
> <VirtualHost domain2.net>
> ServerName domain2.net
> DocumentRoot /home/httpd/domain2.net/html
> </VirtualHost>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

More information about the LUG mailing list