Apache 2 proxy for Tomcat 7

Posted by hsnm on Server Fault See other posts from Server Fault or by hsnm
Published on 2012-10-14T23:12:59Z Indexed on 2012/10/15 3:42 UTC
Read the original article Hit count: 448

Filed under:
|
|

Following the how-to, I wanted to make a proxy for traffic to the address /app to be processed by Tomcat 7.

I added this to my httpd.conf:

LoadModule proxy_module  {path-to-modules}/mod_proxy.so    
LoadModule  deflate_module       modules/mod_deflate.so

ProxyPass         /app  http://localhost:8081
ProxyPassReverse  /app  http://localhost:8081

I also have this on my server.xml:

<Connector port="8081" enableLookups="false" acceptCount="100" connectionTimeout="20000" 
              proxyName="localhost"
              proxyPort="80"/>

And I have the folder /var/lib/tomcat7/webapps/app with my application files.

I restarted both Tomcat 7 and Apache 2 after doing the configurations above.

Problem: When navigating to my webpage.com/app, I get the error 500. I consulted apache logs, it says:

[warn] proxy: No protocol handler was valid for the URL /app. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

Update: This is running in ubuntu. I resolved this by adding LoadModule proxy_http_module modules/mod_proxy_http.so to my httpd.conf.

Now I have another question: How can I make this proxy to work on SSL through port 443?

© Server Fault or respective owner

Related posts about apache2

Related posts about tomcat