502 Bad Gateway 

nginx/1.1.0

 

公司CBS站点出现个别页面不能访问,查到下面解决办法,一查果然有个文件大于为2G。

需重启apache 明天再查是否访问正常!

 

 

 

//

apache 日志文件超过大小限制,导致网站无法正常访问 (2009-11-05 16:49:19)转载▼

标签: 杂谈 分类: linux学习
今天,中午2:40网站突然挂掉,怎么都打不开,重启apache、甚至服务器都不管用!陆陆续续搞了两个小时,最后查了查apache的 error_log 文件,没发现什么异常日志记录,但却有很多类似的记录:
 
[root@localhost logs]# tail error_log
......
[root@localhost logs]# tail error_log
[Thu Nov 05 16:35:29 2009] [notice] child pid 8811 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:29 2009] [notice] child pid 8812 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:29 2009] [notice] child pid 8813 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:30 2009] [notice] child pid 8814 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:30 2009] [notice] child pid 8815 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:31 2009] [notice] child pid 8807 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:31 2009] [notice] child pid 8816 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:32 2009] [notice] child pid 8788 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:32 2009] [notice] child pid 8790 exit signal File size limit exceeded (25)
[Thu Nov 05 16:35:32 2009] [notice] child pid 8817 exit signal File size limit exceeded (25)
到google里搜索,发现了问题的所在:
 
上面的错误记录是说有文件大小超过了限制(超过了apache 2G的文件限制)
 
试用find命令在系统里面查找超大的文件
 
[root@localhost logs]# find / -size +1000000k
find: /proc/9540/task/9540/fd/4: No such file or directory 
find: /proc/9540/fd/4: No such file or directory
/xxxxxxx/xxxxx/logs/php_error.log
 
再查查php_error.log的实际大小
 
[root@localhost /]# ls -al /xxxxxxx/xxxxx/logs/php_error.log
-rw-r--r--  1 root 4294967295 2147483647  7月 10 06:14 /xxxxxxx/xxxxx/logs/php_error.log
 
我靠!!! 这 php_error.log 文件这么大呀!
 
把这文件压缩备份后,删除,然后再重新启动apache
 
[root@localhost /]# /usr/local/apache/bin/apachectl restart
 
搞定了!瞎折腾了这么久