I'm trying to integrate Tomcat with Apache. My aim is to redirect all the requests with
I followed this guide: http://tomcat.apache.org/tomcat-8.0-doc/proxy-howto.html
httpd.conf looks like this:
Include conf.modules.d/*.conf LoadModule proxy_module modules/mod_proxy.so ProxyPass /myapp http://localhost:8080 retry=0 timeout=5 ProxyPassReverse /myapp http://localhost:8080
My server.xml in apache-tomcat looks like this:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" proxyPort="80" />
Now when I try the url
http://localhost/myapp, it gives
503 Service Unavailable error.
Both Tomcat and Apache are up and running. The URL
http://localhost:8080 works fine.
Can there be an issue with file permissions?
tomcat the user and group are
root/root and for
httpd, the user and group are
Am I missing something or am I doing it wrong?
Httpd version is 2.4.6 and Tomcat's version is 8.0
The httpd error logs:
[proxy:error] [pid 19905] (13)Permission denied: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed [proxy:error] [pid 19905] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 0s [proxy_http:error] [pid 19905] [client ::1:51615] AH01114: HTTP: failed to make connection to backend: localhost
This question is tagged with
~ Asked on 2014-09-03 12:35:00
(Answered by the OP in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
Which is a link to a blog that explains:
SELinux on RHEL/CentOS by default ships so that httpd processes cannot initiate outbound connections, which is just what mod_proxy attempts to do.
If this is the problem, it can be solved by running:
/usr/sbin/setsebool -P httpd_can_network_connect 1
And for a more definitive source of information, see https://wiki.apache.org/httpd/13PermissionDenied
~ Answered on 2015-01-28 20:08:26
this worked for me:
ProxyRequests Off ProxyPreserveHost On RewriteEngine On <Proxy http://localhost:8123> Order deny,allow Allow from all </Proxy> ProxyPass /node http://localhost:8123 ProxyPassReverse /node http://localhost:8123
~ Answered on 2017-01-17 00:59:00