
雖然我對 Ubuntu 12.04 沒有任何問題,但在全新的 14.04 安裝中,我無法將 Tomcat 中的應用程式從連接埠 8080 代理程式到 80。
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /myapp http://localhost:8080/myapp
ProxyPassReverse /myapp http://localhost:8080/myapp
但我收到錯誤:
[proxy:error] (110)Connection timed out: AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed
[proxy:error] ap_proxy_connect_backend disabling worker for (localhost) for 60s
[proxy_http:error] AH01114: HTTP: failed to make connection to backend: localhost
我嘗試了幾種配置,但連接總是超時。
答案1
iptables
此問題與阻塞環回埠有關。我需要添加:
sudo iptables -I INPUT 1 -i lo -j ACCEPT