我正在尝试将Tomcat与Apache集成。我的目标是将所有请求重定向
http://localhost/myapp
到http://localhost:8080
我遵循了该指南: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
解决了!
答案在这里:http : //sysadminsjourney.com/content/2010/02/01/apache-modproxy-error-13permission-denied-error-rhel/