I'm trying to set up Apache + Glassfish so that I can access two different webapps on the same physical host, differentiated by the hostname in the URL.
I've been able to get this working in a basic way with mod_proxy and Glassfish virtualservers using this guide. But the user still needs to specify the context-root for one of the apps, i.e.
How can I set things up so that both apps appear as the "root" in their respective URLs?
Do I need two separate Glassfish domains?
Here's the apache config I'm using:
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://localhost:8080/app1 ProxyPassReverse / http://localhost:8080/app1 ServerName host1.com </VirtualHost> <VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/app2 ServerName host2.com </VirtualHost>