Apache http服务器问题 [英] Apache http server problems

查看:24
本文介绍了Apache http服务器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Apache 版本 2.2.20 (ubuntu) 并尝试使用自定义 httpd.conf 设置,但是我收到以下错误消息,并希望能够提供给我任何指导.我是开发团队的一员,并获得了这个自定义 httpd.conf 文件,所以我并不真的认为它是问题的原因(但我并没有完全排除这种可能性).

I am using Apache version 2.2.20 (ubuntu) and attempting to use a custom httpd.conf setup however I am getting the following error message and would appreciate any guidance that can be given to me. I'm part of a dev team and was given this custom httpd.conf file so I don't really assume it to be the cause of the problem (but I'm not totally ruling out that possibility).

我运行命令sudo apache2ctl -k restart"并得到以下结果

I run the command "sudo apache2ctl -k restart" and get the following result

[Fri Jul 06 11:33:34 2012] [warn] module ssl_module is already loaded, skipping
[Fri Jul 06 11:33:34 2012] [warn] module rewrite_module is already loaded, skipping
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action '-k restart' failed.
The Apache error log may have more information.

如果我注释掉 httpd.conf 文件中的行(下面),我可以摆脱这两个警告.我真的想这样做吗?我可以去哪里验证这些模块是否已加载到其他地方,并且在我的 conf 文件中将它们注释掉不会有任何伤害?

The two warnings I can get rid of if I comment out the lines (below) in my httpd.conf file. Do I really want to do this? Where can I go in order to verify that these modules are loaded somewhere else and that commenting them out in my conf file won't hurt anything?

LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so

至于无法绑定到端口 80 的错误,我无法让它消失.当我执行sudo netstat -lnp | grep :80"时,我得到以下内容

As for the error related to not being able to bind to port 80, I cannot get it to go away. When I do a "sudo netstat -lnp | grep :80" I get the following

tcp        0      0 0.0.0.0:80       0.0.0.0:*      LISTEN      6233/apache2

我知道上面的输出意味着 apache 认为它正在运行,并且有一段时间我什至能够看到它工作了!"当我导航到 localhost 时的页面,但现在当我转到该页面时,我只会在 localhost 端口 443 处获得未找到 Apache/2.2.20 (ubuntu) 服务器".此外,我似乎无法杀死运行kill -9 6233"命令的 apache 进程只会导致 apache 的 PID 发生变化(例如从 6233 到 6234).我还尝试使用命令sudo etc/init.d/apache2 stop",它会产生* Stopping web server apache2 [OK]"消息,但我再次看到 apache2 进程占用了端口 80.

I know that the above output means that apache thinks its running and for a time I was even able to see the "It Worked!" page when I navigated to localhost, but NOW I only get "Not Found Apache/2.2.20 (ubuntu) server at localhost port 443" when I go to that page. Also I cannot seem to kill the apache process running the "kill -9 6233" command only causes apache's PID to change (for example from 6233 to 6234). I have also tried to use the command "sudo etc/init.d/apache2 stop", it produces an "* Stopping web server apache2 [ OK ]" message but again I see the apache2 process taking up port 80.

对任何这些问题的想法将不胜感激.

Ideas on any of these issues would be appreciated.

推荐答案

Look: "module xxx_module is already loaded"

Look: "module xxx_module is already loaded"

答案:您不止一次加载这些模块.尝试搜索并评论/删除有问题的行:

Answer: You are loading those modules more than once. Try a search and comment/delete problematic lines:

在 Centos/RHEL:

grep ssl_module -rI /etc/httpd/*   
/etc/httpd/conf/httpd.conf:LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
/etc/httpd/conf.d/ssl.conf:LoadModule ssl_module modules/mod_ssl.so

在这种情况下 ^ 我在 /etc/httpd/conf/httpd.conf 中注释掉了一行,因此所有 SSL 内容都位于 /etc/httpd/conf.d/ssl.conf

In this case ^ I commented out line in /etc/httpd/conf/httpd.conf so all SSL stuff live in /etc/httpd/conf.d/ssl.conf

对于 rewrite_module

grep rewrite_module -rI /etc/httpd/*

在 Debian/Ubuntu 中:

grep ssl_module -rI /etc/apache2/*

这篇关于Apache http服务器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆