种心收默

apache提示make_sock?

[root@localhost apache]# /etc/init.d/*_apache restart
停止 *_apache:                                        [失败]
正在启动 *_apache:(98)Address already in use: make_sock: could not bind to address [::]:99
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:99
no listening sockets available, shutting down
Unable to open logs
                                                           [失败]
[root@localhost apache]#

今天在配置Apache的时候,为了查看记录方便,将所有的APACHE的日志目录下面的文件均删除了

[root@localhost logs]# pwd
/usr/local/*/service/apache/logs
[root@localhost logs]# ll
总用量 28
-rw-r--r-- 1 root root  385 3月  13 16:31 access_log
-rw-r--r-- 1 root root 1083 3月  13 16:31 error_log
-rw-r--r-- 1 root root    6 3月  13 16:31 httpd.pid
-rw-r--r-- 1 root root 3878 3月  13 16:31 mail_access_log
-rw-r--r-- 1 root root 2273 3月  13 16:31 mail_access_log_ip
-rw-r--r-- 1 root root    0 3月  13 16:12 mail_error_log
-rw-r--r-- 1 root root 4771 3月  13 16:31 mail_error_log_ip
[root@localhost logs]# 

然后重启的时候提示上面的错误,最后看文件的时候,竟然有一个httpd.pid文件,好吧。应该是这个pid文件被删除了,导致出现的这个问题了

那直接查一下当前ps进程中的ID号是什么

[root@localhost logs]# ps -ef|grep 'apache'
root     18369     1  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18371 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18372 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18373 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18374 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18375 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18384 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18386 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18387 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18388 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
9004     18389 18369  0 16:31 ?        00:00:00 /usr/local/*/service/apache/bin/httpd
root     18639 12792  0 16:41 pts/0    00:00:00 grep apache
[root@localhost logs]#

然后再直接生成一个httpd.pid文件,内容为主进程ID号

echo "18369">httpd.pid

再重启一下apache服务,最终恢复正常

posted on 2018-03-13 16:45  samcao  阅读(858)  评论(0编辑  收藏  举报

导航