手机版
你好,游客 登录 注册
背景:
阅读新闻

Nginx服务器报500 Internal Server Error错误

[日期:2012-12-13] 来源:Linux社区  作者:linuxshow [字体:大 中 小]

nginx服务器频繁报“500 Internal Server Error”错误,是由于服务器上文炳数设置太小,设置方法如下:
 
1>. /etc/security/limits.conf文件,最后加上两句
 * soft nofile 65535
 * hard nofile 65535
 
2>. /etc/sysctl.conf,增加:
 fs.file-max=65536
 
3>. nginx配置文件nginx.conf,增加:
 
在worker_processes的下面增加一行
worker_rlimit_nofile 65535;
 
操作:
 
1>. sysctl -p
 
2>. 重启nginx

注:看 /etc/profile 文件中是否存在“ ulimit -S -c 0 ”前面添加一个#号
 #etc profile
cmd=`/bin/cat /etc/profile|grep 'ulimit -S -c 0'|grep -v '^#'`
if [ $cmd ]
 then
 /bin/sed -i 's/ulimit -S -c 0/#&/' /etc/profile
fi

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款