我们致力于一个Apache知识的分享网站

Home » Apache解错方案 » apache 无法启动故障排查

apache 无法启动故障排查


2009-02-10 15:15:34  |   才被看了1,107次  |   要评论?
分类: Apache解错方案  |   发布:   |   来源:chding

Tags: ,

今天在F5上逛,发现某个ip下面的机器的80和443端口down了。
于是手动重启,结果发现apachectl start,可以正常启动,apachectl startssl却不行
查看log
[Wed Apr 16 08:54:52 2008] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run?
[Fri Jun 13 11:59:24 2008] [alert] httpd: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
semget: 设备上没有空间
网上查了半天也无解。试图删除/usr/local/apache/logs/httpd.pid再重启也不行。
问同事才知道
使用ipcs查看系统的信号量,发现是信号量sem已经满了,所以导致startssl无法启动。
据说是如果apache没有正常Stop掉的话,它的信号量是不会自动清除的,导致其一直滞留在内存中
于是,用以下命令清除sem信号量后,apache就可以正常启动了:
for i in `ipcs  | grep nobody | awk ‘{print $2}’`; do ipcrm -s $i; done
看来,以后我们需要慎用killall -9 httpd,尽量使apache能正常的stop
[root@l_192_168_131_164 log]# ipcs
—— Shared Memory Segments ——–
key        shmid      owner      perms      bytes      nattch     status      
0×00000000 7143424    root      600        184324     74         dest          
—— Semaphore Arrays ——–
key        semid      owner      perms      nsems      
0×00000000 0          nobody    600        1          
0×00000000 32769      nobody    600        1          
0×00000000 65538      nobody    600        1          
。。。。。。。。。
。。。。。。。。。
0×00000000 98307      nobody    600        1          
—— Message Queues ——–
key        msqid      owner      perms      used-bytes   messages  

可以看到很多
清除了就可以了
for i in `ipcs  | grep nobody | awk ‘{print $2}’`; do ipcrm -s $i; done

然后再查看

[root@l_192_168_132_089 /root]# ipcs
—— Shared Memory Segments ——–
key        shmid      owner      perms      bytes      nattch     status      
0×00000000 8552448    root      600        184324     74         dest          
—— Semaphore Arrays ——–
key        semid      owner      perms      nsems      
0×00000000 8486912    nobody    600        1          
—— Message Queues ——–
key        msqid      owner      perms      used-bytes   messages  

没有那么多了。

再重新启动apache,这次正常启动了
另外一个问题,就是日志是用中文输出的,对应的错误提示在网上无法搜到,而对应的英文

semget: 设备上没有空间
semget: No space left on device
在google上很容易找到结果。看来以后要把服务器的默认语言设置为英文才行。
 
#export LC_ALL=en_US
#locale
 

无相关文章,以下随机显示

标签:, ,

Apache2运用mod_deflate提升网络页面浏览速度 Apache高级配置中文详解

Leave a Reply