[lug] Apache Virtual Hosts and NAT

David Morris boru at frii.com
Fri Feb 23 12:51:46 MST 2001


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 (192.168.1.6).

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 192.168.1.6

<VirtualHost domain1.net>
ServerName domain1.net
DocumentRoot /home/httpd/domain1.net/html
</VirtualHost>

<VirtualHost domain2.net>
ServerName domain2.net
DocumentRoot /home/httpd/domain2.net/html
</VirtualHost>





More information about the LUG mailing list