roychan0328
asked on
Tomcat server root application with apache http proxy on cent os
How to set up tomcat 5 + apache httpd proxy at the root so that
http://mydomain.com will hit my application?
I am running centos and both http and tomcat are running as default sevices.
http://mydomain.com will hit my application?
I am running centos and both http and tomcat are running as default sevices.
ASKER
So I have to move my application to the root of tomcat first, right?
How can I do that?
How can I do that?
No, if your application lives in a subfolder, you can specify the folder:
ProxyPass / ajp://localhost:8091/folder/
ProxyPassReverse / ajp://localhost:8091/folder/
or
ProxyPass /foo ajp://localhost:8091/folder
ProxyPassReverse /foo ajp://localhost:8091/folder
depending upon your needs.
ASKER
does it work with http proxy instead of ajp?
I tried to do this
ProxyPass / http://localhost:8091/folder/
ProxyPassReverse / http://localhost:8091/folder/
and I got 404
apache httpd redirect me to
http://localhost/folderfolder/
I tried to do this
ProxyPass / http://localhost:8091/folder/
ProxyPassReverse / http://localhost:8091/folder/
and I got 404
apache httpd redirect me to
http://localhost/folderfolder/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For apache 2.2, you'll need the following modules (check the LoadModule section of your httpd.conf)
- mod_proxy
- mod_proxy_ajp
You can proxy every request to tomcat via [1] in your httpd.conf, while the port of your tomcat server may differ.
Open in new window