We all know that by default, Linux 1024 of the following port is only the root users have permission to occupy, so our tomcat,apache,nginx and so on, if you want to use ordinary users to occupy 80 ports, it will throw permission denied exception.
There are two ways to solve this problem:
1. Start the program with a non-80 port, and then use Iptables to do a port forwarding.
2. Suppose that we need to start the program is Nginx, then this can also achieve the purpose.
At first we looked at the Nginx permission description:
-rwxr-xr-x 1 nginx Dev 2408122 Sep 5 16:01 Nginx
This time must be unable to start normally.
First modify the user who owns the file as root:
Chown Root Nginx
And then add S permission:
chmod u+s Nginx
When you view the description of the permission again:
-rwsr-xr-x 1 root 2408122 Sep 5 16:01 Nginx
It's no problem to start again this time.
Reference: http://bbs.chinaunix.net/thread-2212303-2-1.html