欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

apache2不能启动的解决办法(提示could not bind to address 0.0.0.0:80)

shiping1 的头像

apache2不能启动的解决办法(提示could not bind to address 0.0.0.0:80)

在ubuntu中用apt-get装好apache2后,用apache2 -k start 等命令都能正常启动、停止服务。

后 来把/usr/share/doc/apache2.2-common/examples/apache2/original /httpd.conf.gz 文件解压,拷贝httpd.conf到 /etc/apache2/目录下,进行修改后再启动apache2,却再也无法启动,提示:

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

于是google,网上基本都是说80端口被其他进程占用了,但是无论是用 #ps auxw 还是 #netstat -ln 都查不出哪个进程占用了80端口,百思不得其解

后来在检查 acache2.conf 文件时发现里面有句话: include /etc/apache2/ports.conf

打开一看,果然,第一行就是 listen 80

注释掉,启动 apache2 OK !!!

原因:httpd.conf和ports.conf中都有listen 80,而这两个文件在apache2启动时都会被加载,原来是apache2自身服务开启时自己占用了自己的端口 OK!!!

有时有多个不同作用的httpd.conf 如果需要的话 改成其它端口
来自 http://hi.baidu.com/zanpen2000/item/79bba69be5a817f4291647d1
普通分类: