sbmzhcn 发表于 2011-5-26 18:59:54

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

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

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

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

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

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

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

/usr/local/php/etc/php-fpm.conf查看结果:
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice


listen = /tmp/php-cgi.sock
user = www
group = www
pm = dynamic
pm.max_children = 20
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3eaccelerator 我没有安装

补充下,lnmp重启状态Restarting LNMP...
Starting Nginx...
Test Nginx configure...
Nginx program is reloding!
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
: bind() to 0.0.0.0:80 failed (98: Address already in use)
Shutting down MySQL..
Starting MySQL..
Gracefully shutting down php-fpmdone
Starting php-fpmdone说下,我这个站怎么设置的: http://www.rockscrusher.comrockscrusher:~# cat /usr/local/nginx/conf/vhost/www.rockscrusher.com.conf
server
      {
                listen       76.163.25.40:80;
                server_name www.rockscrusher.com rockscrusher.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/www.rockscrusher.com;

                location / {
                        try_files $uri @apache;
                        }

                location @apache {
                        internal;
                        proxy_pass http://127.0.0.1:88;
                        include proxy.conf;
                        }

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

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

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

                log_formatwww.rockscrusher.com'$remote_addr - $remote_user [$time_local] $request '
             '$status $body_bytes_sent $http_referer '
             '$http_user_agent $http_x_forwarded_for';
                access_log/home/wwwlogs/www.rockscrusher.com.logwww.rockscrusher.com;
      }rockscrusher:~# cat /usr/local/apache/conf/vhost/www.rockscrusher.com.conf
<VirtualHost *:88>
ServerAdmin webmaster@example.com
php_admin_value open_basedir "/home/wwwroot/www.rockscrusher.com:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/home/wwwroot/www.rockscrusher.com"
ServerName www.rockscrusher.com
ServerAliasrockscrusher.com
ErrorLog "logs/www.rockscrusher.com-error_log"
CustomLog "logs/www.rockscrusher.com-access_log" common
</VirtualHost>

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

[ 本帖最后由 sbmzhcn 于 2011-5-26 19:20 编辑 ]

licess 发表于 2012-3-22 11:44:59

这个的502没见过,发日志看看

sbmzhcn 发表于 2012-4-14 13:17:08

哪儿有日志。
到哪儿去找

licess 发表于 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
页: [1]
查看完整版本: VPS经常性502错误,重启立马解决(附:VPS详细信息)