This article only shows how to open the 80 port specific principle aspects here do not do too much discussion.
After the release of Ubuntu10 Ubuntu disables the use of 1-1024 ports for ordinary users. This way, when we directly change the port in Tomcat's Server.xml, port 80 is not enabled properly. In Catalina.out we will find the following error message.
Severe:failed to initialize end point associated with Protocolhandler ["http-bio-80"]
Severe:failed to initialize connector [connector[http/1.1-80]]
The simplest understanding is that Tomcat does not have a normal 80 port open.
We can open it in the following ways
First, we want to pass authbind to the ordinary user to use a 80 port permission.
The command is as follows
Touch/etc/authbind/byport/80
chmod 500/etc/authbind/byport/80
Chown tomcat7 /etc/authbind/byport/80
(I am the user who runs Tomcat here is TOMCAT7 if other users please change their own)
This gives TOMCAT7 the ability to use port 80 for this normal user.
Second, we then modify the Tomcat's related configuration file
1. Modify the ports in the/etc/tomcat7/server.xml
Change the port of the original Connector port= "8080" protocol= "http/1.1" to 80
Connector port= "protocol=" http/1.1 "
2. Modify the Authbind option in the/etc/default/tomcat7 file.
In general, this option is commented out and it is on the last line.
Change #authbind=no to Authbind=yes
If you don't, you can use port 80 normally.
Note: This happens first when we install Tomcat in this way, with the inability to use port 80.
If the Tomcat binary package is extracted directly and the service is started with the root user, there will be no case where port 80 cannot be opened (this condition has been tested to work 80).
If you feel that the above method is troublesome, you can also change the user and group in the/etc/default/tomcat7 configuration file to root and open port 80 normally. It is not recommended to use this method because root privileges are too large.
The individual does not recommend Tomcat to use the 80 port directly, it is recommended to use Apache or Nginx to do reverse proxy way.
This article is from the "Notes" blog, please be sure to keep this source http://tlinle.blog.51cto.com/251944/1857448
Tomcat uses 80 ports under the UBUNTU14