分享在linux环境下网站提示502 Bad Gateway的解决方法
2014-06-11 23:45
495 查看
网站访问提示502 Bad Gateway怎么解决?根据分析一般是php线程打开文件句柄受限导致的。
分享在linux环境下网站提示502 Bad Gateway的解决方法
1、提升服务器的文件句柄打开打开vi /etc/security/limits.conf 底部加上* soft nofile 51200* hard nofile 51200vi /etc/sysctl.conf 底部添加fs.file-max=51200
2、提升nginx的进程文件打开数vi /www/wdlinux/nginx/conf/nginx.confworker_rlimit_nofile 5120; 改成worker_rlimit_nofile 51200;
3、修改php-fpm.conf文件,主要需要修改2处。vi /www/wdlinux/etc/php-fpm.conf改成下面的值<value name="max_requests">10240</value><value name="rlimit_files">51200</value>
4、设置php-fpm自动启动vi /etc/rc.local 最后增加/etc/init.d/php-fpm start
5、完成之后reboot重启下服务器ulimit -n 查看
原文参考资源共享网:www.5azyw.com/thread-1296-1-1.html
网站访问提示502 Bad Gateway怎么解决?根据分析一般是php线程打开文件句柄受限导致的。
分享在linux环境下网站提示502 Bad Gateway的解决方法
1、提升服务器的文件句柄打开打开vi /etc/security/limits.conf 底部加上* soft nofile 51200* hard nofile 51200vi /etc/sysctl.conf 底部添加fs.file-max=51200
2、提升nginx的进程文件打开数vi /www/wdlinux/nginx/conf/nginx.confworker_rlimit_nofile 5120; 改成worker_rlimit_nofile 51200;
3、修改php-fpm.conf文件,主要需要修改2处。vi /www/wdlinux/etc/php-fpm.conf改成下面的值<value name="max_requests">10240</value><value name="rlimit_files">51200</value>
4、设置php-fpm自动启动vi /etc/rc.local 最后增加/etc/init.d/php-fpm start
5、完成之后reboot重启下服务器ulimit -n 查看
原文参考资源共享网:www.5azyw.com/thread-1296-1-1.html
相关文章推荐
- nginx加php-fpm出现502 bad gateway错误的5种解决方法
- NGINX 502 Bad Gateway 用upstream解决方法
- 今天收到报警邮件,提示网站502 bad gateway,
- nginx加php-fpm报502 bad gateway错误五种解决方法
- lnmp一键包502 Bad Gateway解决方法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- linux系统下nginx+php-fpm报错:502 Bad Gateway解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- 技术分享:VPS小内存LNMP服务器Nginx 502 Bad Gateway故障一分钟内自动恢复解决办法
- Nginx 502 Bad Gateway 错误的原因及解决方法
- Nginx 502 Bad Gateway错误的原因分析与解决方法
- LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法
- Nginx 502 Bad Gateway 错误的原因及解决方法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- lnmp一键包502 Bad Gateway彻底的解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- Nginx 502 Bad Gateway错误常见的4种原因和解决方法