Im using mod_proxy_ajp to redirect from Apache to Tomcat. Apache is runnig on port 80 and tomcat ajp connector set on port 8081. here is my virtual host configuration:
<virtualHost *:80>
ServerName www.example.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8081/example/
ProxyPassReverse / ajp://localhost:8081/example/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
The problem is when i type url www.example.com ( example is in tomcat webapp directory) only the title of example app loads and the browser stop loading and nothing happens.
any idea?
Thanks and sorry for my poor english
Best Answer
In the default configuration, the 8080 port serves HTTP content, and AJP is served using the 8009 port. You can confirm this in tomcat's
server.xml
file, an example:mod_proxy_ajp
does not require aProxyPassReverse
directive, so you can simply replace:with:
in the Apache configuration. Use the appropriate port for AJP.