• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redirect a tomcat application URL and port using apache.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 \
--enable-proxy-http

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic