Ubuntu上的nginx:权限被拒绝

前端之家收集整理的这篇文章主要介绍了Ubuntu上的nginx:权限被拒绝前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是系统管理的新手。在Ubuntu上安装Nginx via puppet后,我得到以下输出
[alert] could not open error log file: open() "/var/log/Nginx/error.log" Failed (13: Permission denied)

[warn] 1898#0: the "user" directive makes sense only if the master process runs with super-user privileges,ignored in /etc/Nginx/Nginx.conf:1

[emerg] 1898#0: open() "/var/log/Nginx/access.log" Failed (13: Permission denied)

如何摆脱所有这些讯息?

我不想直接使用命令行(chown / chmod),并且每次创建一个新的服务器时重复它。因此,我正在考虑什么必须添加到木偶表现。

在这种情况下,最好的系统管理员实践是什么?要更改/ var / log / Nginx的所有者/权限或将日志存储在不同的位置?如果chown / chmod是要走的路,哪些具体的权限会保证最高的安全级别?

我试过这个,但没有帮助:

file { '/var/log/Nginx':
    ensure  => directory,mode    => '0755',owner   => 'www-data',group   => 'www-data',recurse => true
  }

编辑:

vagrant@precise64:~$ ps aux | grep [n]ginx
root      1001  0.0  0.1  62908  1388 ?        Ss   08:47   0:00 Nginx: master process /usr/sbin/Nginx
www-data  1002  0.0  0.1  63260  1696 ?        S    08:47   0:00 Nginx: worker process
www-data  1003  0.0  0.1  63260  1696 ?        S    08:47   0:00 Nginx: worker process
www-data  1004  0.0  0.1  63260  1696 ?        S    08:47   0:00 Nginx: worker process
www-data  1005  0.0  0.1  63260  1696 ?        S    08:47   0:00 Nginx: worker process
确保您以超级用户身份运行测试。
sudo Nginx -t

或者测试没有正确完成测试所需的所有权限。

原文链接:https://www.f2er.com/ubuntu/349581.html

猜你在找的Ubuntu相关文章