hgjgh 发表于 2015-8-5 10:28:58

Apache ProxyPass出现503 Service Temporarily Unavailable错误的解决方案

  -- apache 配置

    ServerName www.mydomain.com
    ProxyRequests Off
   
      Order deny,allow
      Allow from all
   
    ProxyPass / http://192.168.168.132:8089/
    ProxyPassReverse / http://192.168.168.132:8089/


-- 访问 http://www.mydomain.com/ 出现错误信息
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
-- 查看错误日志
# tail /var/log/httpd/error_log
(13)Permission denied: proxy: HTTP: attempt to connect to 192.168.168.132:8089 (192.168.168.132) failed
ap_proxy_connect_backend disabling worker for (192.168.168.132)
-- 猜测SELinux影响
# /usr/sbin/getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
-- 把httpd_can_network_connect设置为on
# /usr/sbin/setsebool -P httpd_can_network_connect=1
# /usr/sbin/getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
再次访问 http://www.mydomain.com/ ,一切OK。
当然关闭 SELinux 也行
1)修改 /etc/selinux/config 然后重启
   SELINUX=disabled
2)# /usr/sbin/setenforce 0   实时生效
页: [1]
查看完整版本: Apache ProxyPass出现503 Service Temporarily Unavailable错误的解决方案