在CentOS 5.5版本的端口80上启动tomcat(Final)

前端之家收集整理的这篇文章主要介绍了在CentOS 5.5版本的端口80上启动tomcat(Final)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在端口80上启动Tomcat 6.0.29.
我的操作系统是CentOS 5.5版(Final)
我在$TOMCAT_HOME / conf / server.xml中更改了以下行
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443"/>

然后我运行命令:

sudo /etc/init.d/tomcat6 start

文件$TOMCAT_HOME / logs / catalina.log中我发现了这样的异常:

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:203)
    at org.apache.catalina.connector.Connector.start(Connector.java:1087)
    at org.apache.catalina.core.StandardService.start(StandardService.java:534)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    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:597)
    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.PlainSocketImpl.bind(PlainSocketImpl.java:365)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at java.net.ServerSocket.<init>(ServerSocket.java:141)
    at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    ... 12 more
0:11:56 org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException:  service.getName(): "Catalina";  Protocol handler start Failed: `java.net.BindException: Permission denied <null>:80
    at org.apache.catalina.connector.Connector.start(Connector.java:1094)
    at org.apache.catalina.core.StandardService.start(StandardService.java:534)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
0:11:56 org.apache.catalina.startup.Catalina start`

提前致谢

1-1023范围内的端口是特权的.只有root可以绑定到它们.

至少有两种方法解决这个问题:

>以root身份运行.当然,你需要重视这个推测的额外的安全隐患; Tomcat本身的两个安全漏洞(我相信很少)和您的Web应用程序包含(例如可以让人们以/ etc / shadow为例),这样做简单直观.
>以jsvc作为服务运行.有关jsvc的详细信息,请参见http://tomcat.apache.org/tomcat-5.5-doc/setup.html.这是一些额外的麻烦设置,但是root只会参与设置端口,Tomcat然后将作为用户运行而没有特殊权限.我建议这个任何严重的设置.

无论您选择什么方式,Tomcat的实际启动都将需要root权限.

/// BR,JenEriC

原文链接:https://www.f2er.com/centos/374084.html

猜你在找的CentOS相关文章