Posts Tagged by apache2

apache2 : (98)Address already in use

突然发现无法连接51kaiyuan.com, 于是准备restart apache2。结果如下:

* Starting web server apache2 (98)Address already in use: make_sock: could not bind to address 222.73.44.209:80
no listening sockets available, shutting down
Unable to open logs                          [fail]

参看端口占用情况: sudo netstat -antup

结果如下:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 222.73.44.209:80 0.0.0.0:*               LISTEN      4954/apache2
……

显然apache2还在运行,为什么restart不成功呢?先stop它再说,

sudo /etc/init.d/apache2 stop

* Stopping web server apache2

httpd (no pid file) not running                    [ OK ]
好了,显示stop成功。再次restart,却还是提示(98)Address already in use,为什么呢?一看端口占用情况,apache2还在?ft,stop apache2成功但是进程还在运行,这是怎么回事呢

强行kill 进程apache2, 再start apache2, 终于成功了。

分享家:Addthis中国