Tomcat startup error java.net. BindException: Permission denied: 80. tomcat startup Error
When Tomcat is started, the following error is reported:
Caused by: java.net. BindException: Permission denied <null>: 80
At org.apache.tomcat.util.net. JIoEndpoint. bind (JIoEndpoint. java: 410)
At org.apache.tomcat.util.net. AbstractEndpoint. init (AbstractEndpoint. java: 640)
At org. apache. coyote. AbstractProtocol. init (AbstractProtocol. java: 434)
At org. apache. coyote. http11.20.acthttp11jsseprotocol. init (AbstractHttp11JsseProtocol. java: 119)
At org. apache. catalina. connector. Connector. initInternal (Connector. java: 978)
... 13 more
Cause: in linux, only the root user can access the port number below 1024, and other users cannot access the port number.
Solution 1:
Use sudo./startup. sh or the root user to start Tomcat.
Solution 2:
Modify the Tomcat server. xml configuration file,
Change the port number to 8081 (or another port number above 1024, but it cannot conflict with other ports on the local machine ),
Then use the root user to log on to the server and execute the port redirection command:
Iptables-t nat-a prerouting-p tcp -- dport 80-j REDIRECT -- to-port 8081
(Redirect to port 8081 when accessing port 80 ).