Assume that, if you have installed tomcat and Apache on that same server, do you like to redirect in tomcat web application behind a Apache server with port 80.
You can use the proxyName and proxyPort on the element.
We can use mod_proxy module in apache server to forward requests for a particular web application,
To establish redirect that application you need to configure the following lines,
Open your apache-tomcat configuration file server.xml and add the below configure line,
# vi server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
proxyName="www.domainanme.com"
proxyPort="80"/>
there are two directives in your httpd.conf file for each web application,
ProxyPass
ProxyPassReverse
open apache httpd.conf file
# vi /usr/local/apache/conf/httpd.conf
You can use any one format,
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPass /application/ http://localhost:8080/
ProxyPassReverse /application/ http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPass /application/ http://localhost:8080/
ProxyPassReverse /application/ http://localhost:8080/
or
ProxyPass /application http://www.domain.com:8080/application/
ProxyPassReverse /application http://www.domain.com:8080/application/
ProxyPass / http://www.domain.com:8080/application/
ProxyPassReverse / http://www.domain.com:8080/application/
ProxyPassReverse /application http://www.domain.com:8080/application/
ProxyPass / http://www.domain.com:8080/application/
ProxyPassReverse / http://www.domain.com:8080/application/
Once updated your changes in both server configuration file restart the servers,
Comments (0)