tomcat7 - 无法远程连接到服务器(端口 8080:连接被拒绝)
tomcat7 - unable to connect remotely to server (port 8080: Connection refused)
我在 Ubuntu 14.04 服务器上使用 PerfSONAR a network measurement tool, which has a UI that depends on tomcat7. I installed the perfsonar-ui,为了测试我的安装,我将浏览器(在 windows 7 机器上)指向地址 http://my_server_address:8080/perfsonar-ui/
.连接失败。
到目前为止我尝试了什么:
- 从多台机器到我的服务器的 ping 操作成功。
- 在服务器本身上,
curl -X GET http://localhost:8080/perfsonar-ui/
,响应状态正常 (200)
在其他服务器上,curl -X GET http://my_server_address:8080/perfsonar-ui/
结果:
curl: (7) Failed to connect to my_server_address port 8080: Connection refused
服务器允许端口 8080 sudo ufw allow 8080
- 禁用服务器上的防火墙
sudo ufw disable
我正在绑定到 0.0.0.0
,所以我的 /etc/tomcat7/server.xml
文件中的连接器看起来像:
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" address="0.0.0.0" />
netstat -ntlp | grep LISTEN
结果:
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN -
还是不行! :(
有人可以帮我解决这个问题吗?谢谢。
我正在关闭它。它与 tomcat 无关。这是一个 iptables 问题,我必须允许传入连接到目标端口 8080。它起作用了!
我找到了一个替代解决方案,只需在 tomcat conf 中的 server.xml 中将端口 8080 替换为端口 80。然后停止并再次启动 tomcat 服务器。它在 Ubuntu 16.4 服务器上测试。
原文:
连接器 port="8080" 协议="HTTP/1.1"
修改:
连接器 port="80" 协议="HTTP/1.1"
当我从我的网站使用 CURL 访问远程 tomcat 服务器时,它对我有用。
API URL 应该是“http://xxx.xxx.xxx.xxx/api/24" in place of "http://xxx.xxx.xxx.xxx:8080/api/24”
我在 Ubuntu 14.04 服务器上使用 PerfSONAR a network measurement tool, which has a UI that depends on tomcat7. I installed the perfsonar-ui,为了测试我的安装,我将浏览器(在 windows 7 机器上)指向地址 http://my_server_address:8080/perfsonar-ui/
.连接失败。
到目前为止我尝试了什么:
- 从多台机器到我的服务器的 ping 操作成功。
- 在服务器本身上,
curl -X GET http://localhost:8080/perfsonar-ui/
,响应状态正常 (200) 在其他服务器上,
curl -X GET http://my_server_address:8080/perfsonar-ui/
结果:curl: (7) Failed to connect to my_server_address port 8080: Connection refused
服务器允许端口 8080
sudo ufw allow 8080
- 禁用服务器上的防火墙
sudo ufw disable
我正在绑定到
0.0.0.0
,所以我的/etc/tomcat7/server.xml
文件中的连接器看起来像:<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" address="0.0.0.0" />
netstat -ntlp | grep LISTEN
结果:tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN -
还是不行! :(
有人可以帮我解决这个问题吗?谢谢。
我正在关闭它。它与 tomcat 无关。这是一个 iptables 问题,我必须允许传入连接到目标端口 8080。它起作用了!
我找到了一个替代解决方案,只需在 tomcat conf 中的 server.xml 中将端口 8080 替换为端口 80。然后停止并再次启动 tomcat 服务器。它在 Ubuntu 16.4 服务器上测试。
原文: 连接器 port="8080" 协议="HTTP/1.1"
修改: 连接器 port="80" 协议="HTTP/1.1"
当我从我的网站使用 CURL 访问远程 tomcat 服务器时,它对我有用。
API URL 应该是“http://xxx.xxx.xxx.xxx/api/24" in place of "http://xxx.xxx.xxx.xxx:8080/api/24”