linux中tomcat启动错误:java.net.BindException: Permission denied <null>:80

解决方案:linux 下将tomcat的server.xml的端口改为80后以tomcat身份无法启动tomcat!
在redhat上启动tomcat(将server.xml中的端口改为80)
su - tomcat -c "$CATALINA_HOME/bin/startup.sh"
后出现:Catalina.start: LifecycleException: null.open: java.net.BindException: Permission denied:80

这是因为只有root用户才可访问1024以下的端口。

解决方法:
重将server.xml中的端口改为8080
然后:iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
(如果用到443,也相应执行以上方法)
即可!

猜你喜欢

转载自duguyiren3476.iteye.com/blog/1564729
今日推荐