分享

Nginx服务器报500 Internal Server Error错误

 大芬油画 2015-03-13

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

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多