This example shows how to configure an Apache proxy server to forward requests to a single back-end Tomcat/tc Server instance with multiple name-based virtual hosts. In this example, mod_proxy is used to forward the requests.
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/ns_vhost1
ServerName www.ns_vhost1.com
ErrorLog logs/ns_vhost1_error.log
TransferLog logs/ns_vhost1_access.log
ProxyPass / http://ns_tomcat_vhost1:8080/
ProxyPassReverse / http://ns_tomcat_vhost1:8080/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/ns_vhost2
ServerName www.ns_vhost2.com
ErrorLog logs/ns_vhost2_error.log
TransferLog logs/ns_vhost2_access.log
ProxyPass / http://ns_tomcat_vhost2:8080/
ProxyPassReverse / http://ns_tomcat_vhost2:8080/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/ns_vhost3
ServerName www.ns_vhost3.com
ErrorLog logs/ns_vhost3_error.log
TransferLog logs/ns_vhost3_access.log
ProxyPass / http://ns_tomcat_vhost3:8080/
ProxyPassReverse / http://ns_tomcat_vhost3:8080/
</VirtualHost>
In order for the Apache index document to be remapped to the ROOT context on the Tomcat/tc Server side, there should be a ROOT web application context for each Tomcat/tc Server virtual host.