我正在嘗試將Tomcat與Apache集成。我的目標是把所有的請求重定向與 http://localhost/myapp
到http://localhost:8080
Httpd返回503服務不可用的mod_proxy for Tomcat 8
我遵循這個指南:http://tomcat.apache.org/tomcat-8.0-doc/proxy-howto.html
我httpd.conf
看起來是這樣的:
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
我在Apache的tomcat的server.xml中的樣子這個:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" proxyPort="80" />
現在當我嘗試url http://localhost/myapp
,它給出了503 Service Unavailable
錯誤。
Tomcat和Apache都啓動並運行。網址http://localhost:8080
工作正常。
是否有文件權限問題?
爲tomcat
的用戶和組的root/root
和httpd
,用戶和組的apache/apache
我缺少的東西還是我做錯了?
的httpd版本是2.4.6和Tomcat的版本是8.0
的httpd的錯誤日誌:
[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
解決了!
答案就在這裏:(。由OP的問題編輯轉換爲一個社區維基答案回答見Question with no answers, but issue solved in the comments (or extended in chat))http://sysadminsjourney.com/content/2010/02/01/apache-modproxy-error-13permission-denied-error-rhel/
apache錯誤日誌裏有什麼? – arco444 2014-09-03 12:54:24
我更新了問題。請檢查 – user2354302 2014-09-03 12:58:53
感謝您的提示。我發現這個http://sysadminsjourney.com/content/2010/02/01/apache-modproxy-error-13permission-denied-error-rhel/它解決了問題 – user2354302 2014-09-03 13:01:20