Apache和httpd正在运行但未在浏览器中打开http:// <ipaddress>

时间:2017-05-13 05:16:22

标签: php html apache

我从浏览器[ http:// ]访问Apache时遇到问题。以下是与apache config相关的详细信息:

  • 我已经在centos 7.2上安装了apache并使用iptables代替firewalld。
  • Apache在端口80上运行

    [root@VMAS04 ~]# netstat -anp | grep 80
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10419/httpd

  • iptables中的防火墙规则是:

        [root@VMAS04 ~]# iptables -S
        -P INPUT ACCEPT
        -P FORWARD ACCEPT
        -P OUTPUT ACCEPT
        -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
        -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
        -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
        -A OUTPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT

  • 我尝试了“telnet localhost 80”,其中包含“ HTTP / 1.1 400错误请求

 [root@VMAS04 ~]# telnet localhost 80
    Trying ::1...
    telnet: connect to address ::1: Connection refused
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    hi
    HTTP/1.1 400 Bad Request
    Date: Sat, 13 May 2017 06:06:53 GMT
    Server: Apache/2.4.6 (CentOS) PHP/5.4.16
    Content-Length: 226
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>400 Bad Request</title>
    </head><body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    </p>
    </body></html>
    Connection closed by foreign host.

任何人都可以帮助我。非常感谢提前。

0 个答案:

没有答案