LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Redirecting Apache website to Tomcat (https://www.linuxquestions.org/questions/linux-newbie-8/redirecting-apache-website-to-tomcat-946875/)

mlnm 05-25-2012 01:43 PM

Redirecting Apache website to Tomcat
 
Hi,
I'm running Apache2.2.3 and Tomcat 7 on my RHEL5 Linux box. Apache2.2.3 is running on the default port 80, Tomcat is running on port 8080.

What I'd like to do is to redirect an incoming request from apache to Tomcat.

For example, say I have www.mysite.com, and I also a web application with jsps. The web application is currently up and running on Tomcat so I can access the web application as www.mysite.com:8080/context path.

domain.mysite.com would serve the same content as www. mysite.com:8080/context path.

acid_kewpie 05-25-2012 01:58 PM

ProxyPass / http://127.0.0.1:8080/context/
ProxyReversePass / http://127.0.0.1:8080/context/

see the mod_proxy documentation for further uses of apache as a reverse proxy.

Alternatively look at mod_jk or mod_proxy_ajp

mlnm 05-30-2012 09:41 AM

thank u for your reply and sorry that i couldn't get back to you quickly,i managed to redirect Apache to tomcat,but the query goes to the ROOT directory and default tomcat page opens,but my web application is in webapps,and i tried the following in httpd.conf file:
Proxy Pass /webapp name ajp://localhost:8009/webapp name
Proxy PassReverse /webapp name ajp://localhost:8009/webapp name
Please provide me with the correct format of directing to my webapp.


All times are GMT -5. The time now is 09:32 AM.