码迷,mamicode.com
首页 > 其他好文 > 详细

nginx总结

时间:2017-09-02 15:29:33      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:chmod   not   查找   usr   nbsp   mis   figure   tps   err   

nginx 安装目录 /usr/local/etc
nginx.conf目录 /usr/local/etc/nginx/nginx.conf
nginx web根目录 /usr/local/var/www/
//后期添加
nginx server配置目录 /usr/local/etc/nginx/servers
 
 
nginx 错误总结
 
1.nginx -s stop出现
nginx: [alert] could not open error log file: open() "/usr/local/var/log/nginx/error.log" failed (13: Permission denied)
 
sudo chmod a+w /usr/local/var/log/nginx/*.log
sudo chmod a+w /usr/local/var
sudo chmod a+w /usr/local/var/run
 
出处:https://stackoverflow.com/questions/42605202/how-do-i-configure-nginx-to-put-its-error-log-file-somewhere-i-have-write-privil
 
2.nginx -s stop出现
nginx: [alert] kill(2040, 15) failed (1: Operation not permitted)
 
sudo nginx -s stop
 
3. nginx -s reload出现
nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
重新启动nginx(在nginx启动时候会生成nginx.pid文件,在nginx关闭会删除该文件,nginx重启也会去查找该文件,若找不到,启动nginx重新生成该文件)
 
4.sudo nginx 启动出现
nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
删除/usr/local/var/run/nginx.pid文件
重新启动

nginx总结

标签:chmod   not   查找   usr   nbsp   mis   figure   tps   err   

原文地址:http://www.cnblogs.com/mengff/p/7466608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!