zoukankan      html  css  js  c++  java
  • 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   实时生效

  • 相关阅读:
    jQuery中的观察者模式(Observer Pattern)
    jQuery异步获取json数据的2种方式
    jQuery制作水平多级下拉菜单
    简单说明CGI和动态请求是什么
    五种IO模型透彻分析
    不可不知的socket和TCP连接过程
    零复制(zero copy)技术
    编译httpd细节
    ansible编译httpd playbook示例
    翻译:CREATE DATABASE语句
  • 原文地址:https://www.cnblogs.com/coffee_cn/p/2950234.html
Copyright © 2011-2022 走看看