Linux system non-root 80 port cannot start the Tomcat problem workaround-forward via iptables port

Source: Internet
Author: User
Tags apache tomcat

2010-07-17 13:21:42 Org.apache.tomcat.util.digester.SetPropertiesRule begin
Warning: [Setpropertiesrule]{server/service/engine/host/context} Setting Property ' Debug ' to ' 0 ' didn't not find a matching proper Ty.
2010-07-17 13:21:42 Org.apache.catalina.core.AprLifecycleListener Init
Info: The APR based Apache Tomcat Native Library which allows optimal performance in production environments is not found O n the Java.library.path:/usr/jdk1.5.0_16/jre/lib/i386/client:/usr/jdk1.5.0_16/jre/lib/i386:/usr/jdk1.5.0_16/jre/ .. /lib/i386
2010-07-17 13:21:42 Org.apache.coyote.http11.Http11Protocol Init
Severity: Error Initializing Endpoint
Java.net.BindException:Permission denied:80
At Org.apache.tomcat.util.net.JIoEndpoint.init (jioendpoint.java:502)
At Org.apache.coyote.http11.Http11Protocol.init (http11protocol.java:176)
At Org.apache.catalina.connector.Connector.initialize (connector.java:1058)
At Org.apache.catalina.core.StandardService.initialize (standardservice.java:677)
At Org.apache.catalina.core.StandardServer.initialize (standardserver.java:795)
At Org.apache.catalina.startup.Catalina.load (catalina.java:530)
At Org.apache.catalina.startup.Catalina.load (catalina.java:550)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25)
At Java.lang.reflect.Method.invoke (method.java:585)
At Org.apache.catalina.startup.Bootstrap.load (bootstrap.java:260)
At Org.apache.catalina.startup.Bootstrap.main (bootstrap.java:412)
2010-07-17 13:21:43 Org.apache.catalina.startup.Catalina Load

As can be seen above, the non-root user does not actually have permission to bind Port 80. The ports below 1024 under Linux are root-specific, and Tomcat is started by default with user Tomcat, so changing the port to Gen Y will generate an error: Java.net.BindException:Permission denied : 80

The workaround is to:

The first step is to change the Tomcat port (Server.xml) back from 80 to 8080.

In the second step, 80 to 8080 forwarding is implemented via the Iptables port, and the command is:

Iptables-t nat-a prerouting-p tcp--dport 80-j REDIRECT--to-port 8080

You can do it directly with the root user!

In this way, the user accesses port 80 and port 8080 in fact to 8080 ports.

Linux system non-root 80 port cannot start the Tomcat problem workaround-forward via iptables port

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.