linux - nginx starts with non-root permissions
为情所困
为情所困 2017-06-17 09:16:20
0
4
1416

I want to start nginx with non-root permissions but the error failed (13: Permission denied). According to the information found on the Internet, I need to modify #user nobody in nginx.conf to: user root, and then reload it. But I follow I did it, but the error still failed (13: Permission denied). How to solve this? Another way is to give a 755 permission, but I am not allowed to use this method. Please guide me, thank you

为情所困
为情所困

reply all(4)
我想大声告诉你

Non-root users cannot listen to ports below 1024.

Only two options:

  1. nginx.conf configuration user nobody; listen <1024+>;

  2. nginx.conf configures user nobody; listen 80; , and then starts it as root in the startup script or service. The worker will run as user nobody, and the master will run as root.

巴扎黑

You can turn off selinux

漂亮男人

Change to your user and group, not root

女神的闺蜜爱上我

Services on ports below 1024 require root privileges to start.
If you want to use an ordinary user to start, it is recommended to configure a sudo permission for the ordinary user.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template