• Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect a tomcat application URL and port using apache.  RSS feed

sudhesh nair
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have multiple jvm instance of tomcat application on a unix server and its running on different port.i would like to
redirect the port and uri.How can i achieve this with the help of apache. i heard we can do it using mod_proxy.

http://myapp.xx.com:18120/offers-service-main (Actual URL)

http://myapp.xx.com/offer -when the user access this url this should get redirect to http://myapp.xx.com:18120/offers-service-main

Currently when i access http://myapp.xx.com/offer i get 404 error.

one way to achieve this is to rename my exploded app name (offers-service-main) to offer. But i dont want to do that.anyway to achieve it.

This what i have done from my side.

1) installed apache 2.2 with mod_proxy

./configure --prefix=/usr/local/apache2.0 \
--enable-proxy \
--enable-proxy-connect \

2) Added the below config in apache

ProxyRequests Off
ProxyPreserveHost On
ProxyPass /offer http://myapp.xx.com:18120/offers-service-main
ProxyPassReverse /offer http://myapp.xx.com:18120/offers-service-main

But the above configuration dosent seems to be work. Let me know if i need to do anything on the tomcat side. Thank you
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!