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

查看:188
本文介绍了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",它会产生"*正在停止Web服务器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.

推荐答案

查找:模块xxx_module 已加载"

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天全站免登陆