Apache随机关机,不能重启。 perl进程使用的80端口。 当我杀死使用端口80的进程时,Apache可以重新启动。
日志和结果:
tail -50 / var / log / httpd / error_log
[Sat Jan 07 00:11:01 2012] [notice] caught SIGTERM, shutting down
ns1:/ proc / 15852#fuser -n tcp 80
80/tcp: 6072 15849 15852
ns1:/ proc / 15852#ls -l
total 0 -r-------- 1 apache apache 0 2012-01-07 00:30 auxv -r--r--r-- 1 apache apache 0 2012-01-07 00:24 cmdline -rw-r--r-- 1 apache apache 0 2012-01-07 00:30 coredump_filter -r--r--r-- 1 apache apache 0 2012-01-07 00:30 cpuset lrwxrwxrwx 1 apache apache 0 2012-01-07 00:37 cwd -> /var/www/html/phpMyAdmin-2.11.5-all-languages -r-------- 1 apache apache 0 2012-01-07 00:24 environ lrwxrwxrwx 1 apache apache 0 2012-01-07 00:37 exe -> /usr/bin/perl dr-x------ 2 apache apache 0 2012-01-07 00:37 fd -r--r--r-- 1 apache apache 0 2012-01-07 00:30 io -r-------- 1 apache apache 0 2012-01-07 00:30 limits -rw-r--r-- 1 apache apache 0 2012-01-07 00:30 loginuid -r--r--r-- 1 apache apache 0 2012-01-07 00:37 maps -rw------- 1 apache apache 0 2012-01-07 00:30 mem -r--r--r-- 1 apache apache 0 2012-01-07 00:30 mounts -r-------- 1 apache apache 0 2012-01-07 00:30 mountstats -rw-r--r-- 1 apache apache 0 2012-01-07 00:30 oom_adj -r--r--r-- 1 apache apache 0 2012-01-07 00:30 oom_score lrwxrwxrwx 1 apache apache 0 2012-01-07 00:37 root -> / -r--r--r-- 1 apache apache 0 2012-01-07 00:30 schedstat -r-------- 1 apache apache 0 2012-01-07 00:30 smaps -r--r--r-- 1 apache apache 0 2012-01-07 00:24 stat -r--r--r-- 1 apache apache 0 2012-01-07 00:30 statm -r--r--r-- 1 apache apache 0 2012-01-07 00:24 status dr-xr-xr-x 3 apache apache 0 2012-01-07 00:30 task -r--r--r-- 1 apache apache 0 2012-01-07 00:30 wchan
ns1:/ proc / 15852#/etc/init.d/httpd restart
Stopping httpd: Starting httpd: Warning: DocumentRoot [/xxx/public_html] does not exist Warning: DocumentRoot [/xxx/private_html] does not exist [Sat Jan 07 00:48:37 2012] [warn] NameVirtualHost xx.xx.xx.xx:80 has no VirtualHosts [Sat Jan 07 00:48:37 2012] [warn] NameVirtualHost xx.xx.xx.xx:443 has no VirtualHosts (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
随机,我的意思是,不确定的时间,在服务器stream量非常低的夜晚有时。 有时会有更多的stream量。
我不知道其他进程是采取端口80或apache仍然使用端口80.如果其他进程采取端口80,我想知道哪些过程,为什么他们采取。 我怎样才能避免这一点。
有问题有一个proc目录ls结果的进程(pid号码15852)。 这个过程使用端口80.也许这将有助于识别问题。
在http错误日志中只有关于这个问题的一行:
[Sat Jan 07 00:11:01 2012] [notice] caught SIGTERM, shutting down
—-新编辑,问题再次发生。 我尝试netstat命令,在这种情况下,PID ID 7574 —-
netstat -tpnl | grep“:80”结果:
ns1:~# netstat -tpnl | grep ":80" tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7574/apache3 -k sta ns1:/proc/7574# more cmdline /usr/sbin/apache3 -k start ns1:/proc/7574# ls /usr/sbin/apache3 ls: cannot access /usr/sbin/apache3: No such file or directory