nginx: configuration file /home/xx.local/etc/nginx/nginx.conf test failed

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

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

 

 

你可能感兴趣的:(Ubuntu和git(WSL),nginx,linux,ubuntu)