我对 Linux 还很陌生。我在 Linux 6 平台上安装了 apache 2.2.21。当我使用./apachectl start
或./apachectl -k start
命令时,它显示 apache 已启动。但当我尝试在任何浏览器中使用它访问 apache 默认页面时,http://<servername>:8080
它显示无法显示页面。
有人能帮我解决这个问题吗?这个问题很紧急。
我还附上了如下所示的 error_log 文件。
错误日志文件:
[Thu Nov 24 08:57:23 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 01:45:58 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 01:46:12 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 01:46:12 2011] [notice] Digest: done
[Fri Nov 25 01:46:13 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 01:54:58 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 01:55:10 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 01:55:10 2011] [notice] Digest: done
[Fri Nov 25 01:55:11 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 01:58:10 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 01:59:41 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 01:59:41 2011] [notice] Digest: done
[Fri Nov 25 01:59:42 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 03:23:14 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 03:27:36 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 03:27:36 2011] [notice] Digest: done
[Fri Nov 25 03:27:37 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 08:52:27 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 08:52:43 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 08:52:43 2011] [notice] Digest: done
[Fri Nov 25 08:52:44 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Fri Nov 25 09:21:39 2011] [notice] caught SIGTERM, shutting down
[Fri Nov 25 09:21:57 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 25 09:21:57 2011] [notice] Digest: done
[Fri Nov 25 09:21:58 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
[Mon Nov 28 01:06:58 2011] [notice] caught SIGTERM, shutting down
[Mon Nov 28 01:07:58 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 28 01:07:58 2011] [notice] Digest: done
[Mon Nov 28 01:07:59 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations
答案1
您提供的错误日志中没有任何内容表明 apache 运行时存在任何问题。
您是否确实将系统配置为听在端口 8080 上?检查其中的 Listen 语句,/etc/httpd/conf/httpd.conf
应该是这样的
Listen 8080
如果你有。如果它说
Listen 80
然后 apache 正在监听标准端口,您可以通过 它进行联系http://<servername>
。
编辑:
假设 Linux 6 指的是 RHEL6 或 CentOS6,那么你很可能没有在防火墙上打开 8080 端口。你可以使用以下命令打开 8080 端口
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
如果可行,请不要忘记使用以下命令保存防火墙配置:
service iptables save