LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2011, 09:18 AM   #1
sudheshpn
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Rep: Reputation: 0
Redirect a tomcat application URL and port using apache.


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
 
Old 06-17-2011, 09:44 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
It totally depends what your app wants to see... what is happening?? are the requests being forwarded at all? any tcp traffic? what about the tomcat logs?
 
Old 06-17-2011, 09:52 AM   #3
sudheshpn
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Original Poster
Rep: Reputation: 0
HTTP Status 404 - /offer

--------------------------------------------------------------------------------

type Status report

message /offer

description The requested resource (/offers) is not available.
 
Old 06-17-2011, 09:53 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right, but that's clearly not what you've configured is it? offer vs offers
 
Old 06-17-2011, 01:22 PM   #5
sudheshpn
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Original Poster
Rep: Reputation: 0
i tried to access http://myapp.xx.com/offer but its not getting redirect. Is there anything i need to do from the tomcat side!
 
Old 06-17-2011, 03:51 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you need to actually pay attention to your logs and investigate. There are a number of things involved in this that could be failing. You can't just say "it doesn't work" and expect a fix. I've already told you to look at your logs and look for network traffic etc, so you should do that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to bring different tomcat based application in same Apache vhost in same URL tkmsr Linux - Server 2 02-25-2011 08:08 PM
apache redirect url Radioactiveman Red Hat 1 07-29-2009 01:40 PM
How to redirect URL in apache chnlinux Linux - Newbie 1 01-08-2009 04:15 AM
URL redirect in apache maniannam Linux - Server 2 01-05-2009 01:03 AM
how to redirect url in apahce or tomcat? jimmyjiang Red Hat 2 11-12-2007 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration