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


    -- apache 配置
    <VirtualHost *:80>
        ServerName www.mydomain.com
        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyPass / http://192.168.168.132:8089/
        ProxyPassReverse / http://192.168.168.132:8089/
    </VirtualHost>


    -- 访问 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
    [Fri Mar 08 16:38:14 2013] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 192.168.168.132:8089 (192.168.168.132) failed
    [Fri Mar 08 16:38:14 2013] [error] 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   实时生效

  • 相关阅读:
    封装好的AFN网络请求框架和MBProgress
    iOS定时器的使用
    iOS去除导航栏和tabbar的1px横线
    移动端加解密
    改变字符串中部分字符传的字体大小和颜色
    关于NSLog
    ipad开发:二维码扫描,摄像头旋转角度问题解决办法
    iOS-图文表并茂,手把手教你GCD
    计算富文本的高度
    jsp打印
  • 原文地址:https://www.cnblogs.com/coffee_cn/p/2950234.html
Copyright © 2020-2023  润新知