nginx启动失败

输入:nginx -t -c $HOME/.local/etc/nginx/nginx.conf

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2021/02/17 01:42:50 [warn] 3784#3784: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /home/xx/.local/etc/nginx/nginx.conf:1
nginx: the configuration file /home/xx/.local/etc/nginx/nginx.conf syntax is ok
2021/02/17 01:42:50 [emerg] 3784#3784: mkdir() "/var/lib/nginx/fastcgi" failed (13: Permission denied)

输入: sudo nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

发现一切正常!

解决办法: sudo /etc/init.d/nginx start

就能够启动了!!!然后一切正常!

 

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐