首页 > 代码库 > (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

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

问题说明80端口被占用,用netstat -nlp |grep :80命令看看有什么进程占用了80端口,发现是httpd进程。

没想到安装了两个apache,我安装apache2.4的时候删除了2.2的apache啊,

可能是安装php memcache扩展的时候莫名其妙的安装了上了。

总之要卸载它

rpm -qa|grep -i httpd 

rpm -e --nodeps httpd-2.2.15-59.el6.centos.x86_64

rpm -e --nodeps httpd-tools-2.2.15-59.el6.centos.x86_64

然后需要注册到系统服务 才能使用service httpd start

 httpd: unrecognized service

cd /usr/local/apache2/bin

cp apachectl /etc/rc.d/init.d/httpd

增加环境变量 :

export PATH=$PATH:/usr/local/apache2/bin

后才可以使用 httpd -v 查看版本

http://blog.csdn.net/waitig1992/article/details/47949669

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