Tomcat启动报错:Java.net.BindException: Permission denied:80
1,启动报错显示 [org.springframework.web.servlet.DispatcherServlet]FrameworkServlet 'springMvc': initialization completed in 382 ms Jun 01, 2015 6:39:06 PM org.apache.coyote.http11.Http11Protocol start SEVERE: Error starting endpoint java.net.BindException: Permission denied <null>:80 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549) at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565) at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:207) at org.apache.catalina.connector.Connector.start(Connector.java:1196) at org.apache.catalina.core.StandardService.start(StandardService.java:540) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.net.BindException: Permission denied at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:376) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:181) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538) ... 12 more Jun 01, 2015 6:39:06 PM org.apache.catalina.core.StandardService start SEVERE: Failed to start connector [Connector[HTTP/1.1-80]] LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Permission denied <null>:80 at org.apache.catalina.connector.Connector.start(Connector.java:1203) at org.apache.catalina.core.StandardService.start(StandardService.java:540) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Jun 01, 2015 6:39:06 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:9109 Jun 01, 2015 6:39:06 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/17 config=null Jun 01, 2015 6:39:06 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 6868 ms问题分析:在SUSE上只有root用户才可以访问1024以下的端口号,其余用户不能访问。
2,解决方案 2.1,修改Tomcat的server.xml配置文件,将端口修改为8081(或者其他1024以上的端口号,不能与本机上的其它Tomcat端口冲突) [root@tomcat57conf]# vim /usr/local/app/apache-tomcat-6.0.37_hechuang_lib/conf/server.xml <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="30000" maxThreads="2000" acceptCount="2000" URIEncoding="UTF-8" redirectPort="9143" /> <!-- A "Connector" using the shared thread pool--> 2.2,然后使用root用户登录服务器,执行端口重定向命令:iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8081。