Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup mod_proxy on apache http server

I wanted to reverse proxy a web service from my tomcat server using apache web server. I have modified the httpd.conf

LoadModule proxy_module modules/mod_proxy.so  <Directory />     AllowOverride none     Require all denied </Directory>  ProxyPass         /ROOT  http://localhost:8080/ROOT ProxyPassReverse  /ROOT  http://localhost:8080/ROOT 

My Tomcat server runs on port 8080, now when I run localhost/ROOT, I get error 500 internal server error.

This last entry in the error_log is:

 [Thu Jul 04 14:17:00.097359 2013] [proxy:warn] [pid 18980:tid 4476780544] [client 127.0.0.1:50525] AH01144: No protocol handler was valid for the URL /ROOT. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. 
The last entry in the access_log is:
  127.0.0.1 - - [04/Jul/2013:14:17:00 -0400] "GET /ROOT HTTP/1.1" 500 528 

Any idea on what I am doing wrong here?

like image 221
user1386101 Avatar asked Jul 04 '13 17:07

user1386101


People also ask

What is mod_proxy in Apache?

mod_proxy is an optional module for the Apache HTTP Server. This module implements a proxy, gateway or cache for Apache. It implements proxying capability for AJP13 (Apache JServ Protocol version 1.3), FTP, CONNECT (for SSL), HTTP/0.9, HTTP/1.0, and (since Apache 1.3. 23) HTTP/1.1.

What is proxy timeout in Apache?

Apache Default timeout is set to 300 seconds. This issue comes only when accessing website through apache reverse proxy. It works well by using internal IP.

What is forward proxy and reverse proxy in Apache?

A traditional forward proxy server allows multiple clients to route traffic to an external network. For instance, a business may have a proxy that routes and filters employee traffic to the public Internet. A reverse proxy, on the other hand, routes traffic on behalf of multiple servers.


1 Answers

So it took some time but I figured out the way to do it. There is one more module which needs to be loaded. This is what the httpd.conf looks like

LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so  <Directory />     AllowOverride none     Require all denied </Directory>  ProxyPass         /ROOT  http://localhost:8080/ROOT ProxyPassReverse  /ROOT  http://localhost:8080/ROOT 

This works for sure. :)

like image 106
user1386101 Avatar answered Sep 22 '22 22:09

user1386101