apache端口被异常占用导致无法启动的解决方法
Apache无法启动的问题,Apache提示以下信息:
(98)Address already in use: make_sock: could not bind to address 127.0.0.1:88
no listening sockets available, shutting down
Unable to open logs
英文的主要意思是apache需要的端口被占用(可能是异常启动),导致apache无法使用需要的的端口(这里演示为88,自行安装的apache为80)。
一、检查端口被哪个进程占用
netstat -lnp|grep 88 #88请换为你的apache需要的端口,如:80
SSH执行以上命令,可以查看到88端口正在被哪个进程使用。如下图,进程号为 1777 。
二、查看进程的详细信息
ps 1777
SSH执行以上命令。查看相应进程号的程序详细路径。如下图。
三、杀掉进程,重新启动apache
kill -9 1777 #杀掉编号为1777的进程(请根据实际情况输入) service httpd start #启动apache
SSH执行以上命令,如果没有问题,apache将可以正常启动。
# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(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
[FAILED]
1.netstat -lnp|grep 80
tcp 0 0 192.168.180.68:61027 0.0.0.0:* LISTEN 6289/oproxyd
tcp 0 0 :::80 :::* LISTEN 846/httpd
tcp 0 0 ::ffff:192.168.180.68:7001 :::* LISTEN 32015/java
找到pid 846
#ps 846
查看
#kill -9 846
杀掉
#./apachectl start
启动成功
*****************************************************************************
处理办法:
# ps -aux | grep http
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 12079 0.0 0.0 61164 720 pts/1 S+ 16:06 0:00 grep http
# ps -aux | grep apache
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
apache 10820 0.0 0.0 2044 600 ? Ss Jan01 0:04 bash
root 12081 0.0 0.0 61160 716 pts/1 S+ 16:06 0:00 grep apache
# kill -9 10820
# /etc/init.d/httpd start
Starting httpd: [ OK ]
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
没有评论