【问题标题】:Linux Centos 6 Some how filtered port 80 + broke Apache 2Linux Centos 6 一些如何过滤端口 80 + 破坏了 Apache 2
【发布时间】:2013-07-01 21:25:42
【问题描述】:

按照指南安装 PHPMyAdmin (http://www.krizna.com/centos/installing-apache2-mysql-server-php-centos-6-lamp/#apache) 时,我奇迹般地破解了 80 端口/Apache 服务器

在我开始指南之前,Apache 2 正在为我工​​作(能够查看页面并看到默认的蓝色页面)

我按照指南进入“PHP 安装”下的第 4 步并检查页面,我收到以下错误(注意:我跳过了 Mysql 安装,因为我已经安装了它,并且在Apache 部分,因为我之前有它工作过)。

错误

无法检索到请求的 URL

The following error was encountered while trying to retrieve the URL: http://`192.168.141.22`/

Read Error

The system returned: (104) Connection reset by peer

An error condition occurred while reading data from the network. Please retry your request.

Your cache administrator is webmaster.


Generated Wed, 03 Jul 2013 19:04:56 GMT by tx22rrpep4da (hpm/3.0.55)

我尝试卸载(yum 擦除)httpd 和 php 并重新安装,但没有成功。

我做了一个 nmap,它显示 80/tcp 过滤的 http。

我什至禁用/停止了 IP 表,因为这是问题所在,但运气不好。我有其他的东西,比如 TS3 可以在其他端口上运行。

重新启动专用服务器。

netstat -tulpn

te       PID/Program name
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      25896/httpd
tcp        0      0 0.0.0.0:30033               0.0.0.0:*                   LISTEN      2967/./ts3server_li
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      2736/named
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      2798/sshd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2873/master
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      2736/named
tcp        0      0 0.0.0.0:10011               0.0.0.0:*                   LISTEN      2967/./ts3server_li
tcp        0      0 ::1:53                      :::*                        LISTEN      2736/named
tcp        0      0 :::22                       :::*                        LISTEN      2798/sshd
tcp        0      0 ::1:953                     :::*                        LISTEN      2736/named
udp        0      0 0.0.0.0:9987                0.0.0.0:*                               2967/./ts3server_li
udp        0      0 127.0.0.1:53                0.0.0.0:*                               2736/named
udp        0      0 ::1:53                      :::*                                    2736/named

我让其他几个人测试了 IP,以防它只是我的连接,但他们都得到了相同的结果(IP:192.168.141.22

真的希望我能解决这个问题,而无需做一些过度的事情,比如擦除和重新安装 centos 6。

【问题讨论】:

  • 如果 Apache 正在工作并且您按照安装 Apache 的指南进行操作,那么似乎重新安装可能会重置您的一些配置项。在明确回答之前,这需要一些挖掘才能找出问题所在。我会先检查防火墙是否阻塞(执行 wget localhost,然后执行 telnet localhost 80 并查看您得到的结果)
  • 对于 wget localhost: --2013-07-04 00:17:28-- localhost Resolving localhost... 127.0.0.1 连接到 localhost|127.0.0.1|:80...连接的。已发送 HTTP 请求,等待响应... 403 Forbidden 2013-07-04 00:17:28 错误 403:禁止。对于 telnet localhost 80 我得到: [root@ns4007521 ~]# telnet localhost 80 Trying 127.0.0.1... 连接到 localhost。转义字符是 '^]'。连接被外部主机关闭。

标签: linux apache port centos6


【解决方案1】:

netstat 命令显示 Apache 确实在监听以下 IP 和端口:

 0 0.0.0.0:80  

如果您想在 192... ip 中访问 Apache,那么您需要编辑具有“Listen”指令的 .conf 文件之一(通常在 /etc/httpd/conf.d/ports.conf 或main .conf 文件),然后输入 ip 或删除所有 ip,以便 Apache 可以侦听机器中所有可用的接口。

【讨论】:

  • 好的,我从 httpd.conf 中删除了 Listen 0.0.0.0:80(没有端口一)重置 httpd 没有运气。启动 httpd:没有可用的监听套接字,正在关闭 无法打开日志 我应该将其设置为端口 80 吗?
猜你喜欢
  • 2015-07-22
  • 2014-01-31
  • 1970-01-01
  • 2017-06-16
  • 2017-09-21
  • 2011-08-14
  • 2014-02-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多