OS: Ubuntu2 Servers: Apache2,Tomcat 7
I'm missing knowledge of apache and tomcat configuration.
Is it possible to create a vhost example.com
<VirtualHost *:80> ServerName example.com # PseudoCode DocumentRootJava /var/www/example/ DocumentRootPhp /var/www/app/ </VirtualHost
Where /var/www/example/ hosts a java application and /var/www/app hosts a php application?
In other words example.com should fire the java app and example.com/app should run php Code.
EDIT
I think apaches mod_proxy can do the job:
<VirtualHost *:80> ServerName example.com ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/tomcat-application ProxyPassReverse / http://example.com/ </VirtualHost>
Redirects all domain calls to tomcat. but how can I tell mod_proxy that a call to example.com/app should go to /var/www/app/ and should not be redirected to tomcat but should be processed by apache / PHP ?