tomcat报:java.net.BindException: Permission denied <null>:80
来源:互联网 发布:win7删除u盘linux分区 编辑:程序博客网 时间:2024/05/16 12:36
前段时间遇到一个情况,官网的服务器reboot之后,发现输入官网连接打不开了,最后去查了一下日志发现:tomcat报权限不够的错误,如下:
服务器重启后,tomcat报错:
SEVERE: Error starting endpointjava.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
原因:
通过查找了一些子列发现是因为 Linux 下的权限系统限制导致普通用户无法用80端口, 只有root用户才可访问1024以下的端口。
解决方案:
解决方法1:
在启动Tomcat时,使用sudo ./startup.sh或使用root用户启动
解决方法2:
1、将 server.xml 中已修改的 80 端口重新改为 8081(或者其它1024以上的端口号,但与本机上的其它端口不冲突)。如:
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="30000" maxThreads="2000" acceptCount="2000" URIEncoding="UTF-8" redirectPort="9143" />
2、在Linux下执行:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8081
将80端口映射至8081, 达到我们直接输入域名而不带端口号的目的
阅读全文
1 0
- tomcat报:java.net.BindException: Permission denied <null>:80
- tomcat启动报错:java.net.BindException: Permission denied <null>:80
- Tomcat 启动报错 java.net.BindException: Permission denied :80
- Tomcat启动时报错:java.net.BindException: Permission denied <null>:80
- linux中tomcat启动错误:java.net.BindException: Permission denied <null>:80
- java.net.BindException: Permission denied
- java.net.BindException: Permission denied
- Linux服务器上Tomcat6绑定80端口提示java.net.BindException: Permission denied <null>:80
- Tomcat启用80/443端口的时候提示“java.net.BindException: Permission denied:80”,怎么解决?
- 【腾讯云开发中的坑1】java.net.BindException: Permission denied <null>:443
- java.net.BindException: bind failed: EACCES (Permission denied)
- tomcat报错:java.net.SocketException: Permission denied["http-nio-80"]
- tomcat启动报错:java.net.BindException: Address already in use: JVM_Bind<null>:8080
- tomcat启动报错java.net.BindException: Address already in use<null>:8080
- tomcat启动在80端口 Permission denied <null>:80
- tomcat起步在80端口 Permission denied <null>80
- tomcat报错java.net.BindException: Address already in use
- tomcat报错:Could not load java.net.BindException
- Base64编码格式图片字符串-保存图片到Tomcant中
- python 关键 贰
- 实现深度复制
- php-fpm的配置和优化
- 在notepad++中安装Python环境
- tomcat报:java.net.BindException: Permission denied <null>:80
- DPDK(13):rte_malloc内存管理
- php-fpm配置
- [绍棠_Swift] swift4.0 NSMutableAttributeString的Range和NSRange问题
- php扩展开发---kqueue 实例
- Linux系统--脚本Bash
- IE11下,<!doctype>声明加html不能加载css的问题
- 第十周 项目2
- 二次开发 app项目用android studio打包