After a great deal of searching the net for answers I have pieced together what is needed to do a couple of things I have wanted to do for some time now. The first is to have virtual hosts working nicely on 10.7 Lion Server. The second and related item is to have multiple web servers within a LAN accessible from one WAN address.
Virtual Hosts
To get this working add the following line to the /etc/apache2/httpd.conf file and then restart the web service.
NameVirtualHost *:80
Restarting the web service can be done in the Terminal using:
sudo serveradmin stop web
sudo serveradmin start web
Now you can add virtual hosts through the Server app.
Multiple web servers within a LAN accessed from one WAN address.
Set up: The following assumes that you have 3 servers with correctly working DNS and apache services. The 10.10.10.x subnet is used for the examples, change them to whatever configuration you are using.
Set up a NAT rule on your router/modem to point port 80 through to, for example, 10.10.10.200 (or the address of the primary apache service that will redirect domains to their correct machine):
<VirtualHost *:80> ServerName first.domain.com ProxyPreserveHost on ProxyPass / http://server1.domain.com/ ProxyPassReverse / http://server1.domain.com/ </VirtualHost>
<VirtualHost *:80> ServerName second.domain.com ProxyPreserveHost on ProxyPass / http://server2.domain.com/ ProxyPassReverse / http://server2.domain.com/ </VirtualHost>
<VirtualHost *:80> ServerName third.domain.com ProxyPreserveHost on ProxyPass / http://server3.domain.com/ ProxyPassReverse / http://server3.domain.com/ </VirtualHost>
Mac OS X Hints
http://hints.macworld.com/article.php?story=2011101123595425