I need help figuring out the root cause of this permission denied error. What permissions does nginx need? Why is it so complicated?
相关问题
- Django check user group permissions
- How can I prevent my Shiny App from disconnecting
- Can't configure nginx as a proxy for tomcat wi
- How to set Nginx URI to fix empty URI in redirect
- SQL Server 2012- Create Database permission denied
nginx needs root access. please use
next step along with your password
The best solution would be:
1) add user to sudoers ( my user is prod)
2) inside circus ( process manager ) append sudo before nginx executable, mine looks like this:
3) and finaly add line into file /etc/sudoers ( my user is prod). This line avoids error (sudo: no tty present and no askpass program specified). Probably need to restart session ( reboot). Enjoy.
If you use a port bigger than 1024 and root privilege, then still get this problem, that's may cause by
SELinux
:Check this port, say 8024, in segange port
If the port list no 8024, then add it into segange port
update in 2017.12.22
Sometimes your SELinux is
disabled
, you need toenforcing
it first. Check the status of SELinux by$ sestatus
More steps can read this wonderful article: https://www.digitalocean.com/community/tutorials/an-introduction-to-selinux-on-centos-7-part-1-basic-concepts
If see this msg after run "nginx -t", you dont have premission run as root "sudo nginx -t"
the socket API bind() to a port less than 1024, such as 80 as your title mentioned, need root access.
here is "Bind to ports less than 1024 without root access"
and another easier way is to run nginx as root.