VPS侦探论坛

 找回密码
 注册
查看: 8842|回复: 3

VPS经常性502错误,重启立马解决(附:VPS详细信息)

[复制链接]
发表于 2011-5-26 18:59:54 | 显示全部楼层 |阅读模式

uname -a
Linux rockscrusher.com 2.6.18-028stab089.1 #1 SMP Thu Apr 14 13:46:04 MSD 2011 x86_64 GNU/Linux

以下是重启时的状态
  1. rockscrusher:~# /root/lnmpa restart
  2. =========================================================================
  3. Manager for LNMPA V0.7  ,  Written by Licess
  4. =========================================================================
  5. LNMPA is a tool to auto-compile & install Nginx+MySQL+PHP+Apache on Linux
  6. This script is a tool to Manage status of LNMPA
  7. For more information please visit http://www.lnmp.org

  8. Usage: /root/lnmpa {start|stop|reload|restart|kill|status}
  9. =========================================================================
  10. Stoping LNMP...
  11. Nginx program is stop
  12. httpd (pid 30483?) not running
  13. Shutting down MySQL..
  14. MySQL program is stop
  15. Starting LNMPA...
  16. Nginx start successfully!
  17. Starting MySQL..
  18. MySQL start successfully!
复制代码
我网站流量不高,为什么老是502,只要重启就行,是不是哪儿有问题。

VPS在这儿买的,http://cn.ixwebhosting.com/vps-hosting.php   买的X2系列。 debian系统。

我看了502的几种原因,我的是前段时间正常,这两天出现了问题。

free -m 查看的结果
  1. rockscrusher:~# free -m
  2.              total       used       free     shared    buffers     cached
  3. Mem:          1024        314        709          0          0          0
  4. -/+ buffers/cache:        314        709
  5. Swap:            0          0          0
复制代码
/usr/local/php/etc/php.ini  查看结果 max_execution_time = 300, 这儿没有问题。

/usr/local/php/etc/php-fpm.conf  查看结果:
  1. [global]
  2. pid = /usr/local/php/var/run/php-fpm.pid
  3. error_log = /usr/local/php/var/log/php-fpm.log
  4. log_level = notice

  5. [www]
  6. listen = /tmp/php-cgi.sock
  7. user = www
  8. group = www
  9. pm = dynamic
  10. pm.max_children = 20
  11. pm.start_servers = 2
  12. pm.min_spare_servers = 1
  13. pm.max_spare_servers = 3
复制代码
eaccelerator 我没有安装

补充下,lnmp重启状态
  1. Restarting LNMP...
  2. Starting Nginx...
  3. Test Nginx configure...
  4. Nginx program is reloding!
  5. the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
  6. configuration file /usr/local/nginx/conf/nginx.conf test is successful
  7. [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
  8. Shutting down MySQL..
  9. Starting MySQL..
  10. Gracefully shutting down php-fpm  done
  11. Starting php-fpm  done
复制代码
说下,我这个站怎么设置的: http://www.rockscrusher.com
  1. rockscrusher:~# cat /usr/local/nginx/conf/vhost/www.rockscrusher.com.conf
  2. server
  3.         {
  4.                 listen       76.163.25.40:80;
  5.                 server_name www.rockscrusher.com rockscrusher.com;
  6.                 index index.html index.htm index.php default.html default.htm default.php;
  7.                 root  /home/wwwroot/www.rockscrusher.com;

  8.                 location / {
  9.                         try_files $uri @apache;
  10.                         }

  11.                 location @apache {
  12.                         internal;
  13.                         proxy_pass http://127.0.0.1:88;
  14.                         include proxy.conf;
  15.                         }

  16.                 location ~ .*\.(php|php5)?$
  17.                         {
  18.                                 proxy_pass http://127.0.0.1:88;
  19.                                 include proxy.conf;
  20.                         }

  21.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  22.                         {
  23.                                 expires      30d;
  24.                         }

  25.                 location ~ .*\.(js|css)?$
  26.                         {
  27.                                 expires      12h;
  28.                         }

  29.                 log_format  www.rockscrusher.com  '$remote_addr - $remote_user [$time_local] $request '
  30.              '$status $body_bytes_sent $http_referer '
  31.              '$http_user_agent $http_x_forwarded_for';
  32.                 access_log  /home/wwwlogs/www.rockscrusher.com.log  www.rockscrusher.com;
  33.         }
复制代码
  1. rockscrusher:~# cat /usr/local/apache/conf/vhost/www.rockscrusher.com.conf
  2. <VirtualHost *:88>
  3. ServerAdmin webmaster@example.com
  4. php_admin_value open_basedir "/home/wwwroot/www.rockscrusher.com:/tmp/:/var/tmp/:/proc/"
  5. DocumentRoot "/home/wwwroot/www.rockscrusher.com"
  6. ServerName www.rockscrusher.com
  7. ServerAlias  rockscrusher.com
  8. ErrorLog "logs/www.rockscrusher.com-error_log"
  9. CustomLog "logs/www.rockscrusher.com-access_log" common
  10. </VirtualHost>
复制代码


我的VPS有两个IP,不知道是不是我这设置的原因。

[ 本帖最后由 sbmzhcn 于 2011-5-26 19:20 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-3-22 11:44:59 | 显示全部楼层


这个的502没见过,发日志看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-4-14 13:17:08 | 显示全部楼层

哪儿有日志。
到哪儿去找
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-4-14 17:29:28 | 显示全部楼层



你到底是lnmp还是lnmpa
lnmp升级到lnmpa后就不会有php-fpm

/home/wwwlogs/nginx_error.log
/usr/local/apache/logs/www.rockscrusher.com-error_log
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 19:38 , Processed in 0.027477 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表