Linux Normal User start Nginx

Source: Internet
Author: User

As we all know, Apache Port 80 is the system reserved port, if it is started by other non-root users, the error is as follows: ( -) Permission Denied:make_sock:could not bind to address [::]: the( -) Permission Denied:make_sock:could not bind to address0.0.0.0: theNo listening sockets available, shutting downunable to open logs because ordinary users can only use more than 1024 of the port, the port within 1024 can only be used by the root user. However, in order to avoid each boot through the root user, the set UID can be used to resolve the problem. This can be done at once. In the root user environment, do the following: CD .../apache/binChownRoot httpdchmodu+s httpd againsu-username to ordinary users, through .../apache/bin/apachectl start to why not chmod u+What about s apachectl? Because the set UID is only valid for binary files, and tail a bit apachectl found: Apachectl is a script file, look closely to find like the next sentence httpd='/home/....../apache/bin/httpd'It concludes that the Apachectl script starts the entire HTTPD service by starting the httpd file. Again cat httpd, there are a variety of unreadable garbled, CTRL+c After the output is finished, it is determined that httpd is a binary file. Last chmod u+s httpd can, of course, ensure that the owner of httpd is the root user, if not, execute:Chownroot httpd can be. Similarly, Nginx boot is also the same, with the root user into .... nginx/Sbin then chown root Nginxchmodu+s Nginx can then be started by ordinary users. Again, so does Tomcat. Of course, it is also possible to modify the default port to greater than 1024. 


---------------------------------------------------------------------------------------

From: http://blog.itpub.net/29773961/viewspace-1377290/

Linux Normal User start Nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.