简体   繁体   English

Azure Centos Tomcat部署

[英]Azure Centos Tomcat deployment

I spun up Azure Centos 7 VM. 我启动了Azure Centos 7 VM。 Downloaded and installed tomcat apache server 7. When I run curl http:// localhost:8080 it displays the html file. 下载并安装了tomcat apache服务器7.当我运行curl http:// localhost:8080时,它将显示html文件。

When I try to access it from my desktop as http:// ext_ipaddress:8080/, it fails "This site can't be reached" 当我尝试以http:// ext_ipaddress:8080 /从桌面访问它时,它失败“无法访问此站点”

when I do telnet from my desktop telnet ext_ipaddress 8080, it fails 当我从桌面telnet ext_ipaddress 8080执行telnet时,它失败

"Could not open connection to the host, on port 8080: Connect failed" “无法在端口8080上打开到主机的连接:连接失败”

When I do telnet ext_ipaddress 80 it displays a blank screen which I assume is success. 当我执行telnet ext_ipaddress 80时,它将显示一个黑屏,我认为这是成功的。

Firewall is not running on the VM and when I sudo netstat -lnp 当我在sudo netstat -lnp上时,防火墙未在VM上运行

tcp6 0 0 :::8080 :::* LISTEN 2459/java tcp6 0 0 ::: 8080 ::: * LISTEN 2459 / java

I dont see port 80 listening anywhere. 我看不到端口80在任何地方监听。

I have attached the NSG: 我已附上NSG:

非政府组织

[Update] [更新]

I tried installing only Apache webserver and was able to access apache HTTP server page from my desktop with http://ext_ipaddress 我尝试仅安装Apache Web服务器,并且能够使用http:// ext_ipaddress从我的桌面访问apache HTTP服务器页面

Normally, this issue may be caused by the misconfigured local firewall. 通常,此问题可能是由错误配置的本地防火墙引起的。 (iptables) (iptables)

To verify if this issue is caused by local firewall, please try to perform a network capture on the VM when you try to connect to it from your client. 要验证此问题是否是由本地防火墙引起的,请在尝试从客户端连接到VM时尝试在VM上执行网络捕获。

If the packets from client are captured, it means that Azure doesn't block the connection. 如果捕获了来自客户端的数据包,则意味着Azure不会阻止连接。 Then you should check if there is anything on the VM blocking the connection. 然后,您应该检查VM上是否有任何东西阻止连接。 The most common cause is iptables. 最常见的原因是iptables。

Please try to run the following command to open the TCP port 8080. 请尝试运行以下命令以打开TCP端口8080。

firewall-cmd --zone=public --add-port=8080/tcp --permanent 防火墙cmd --zone = public --add-port = 8080 / tcp --permanent

firewall-cmd --reload 防火墙cmd-重新加载

Then to check if this change takes effect, please run the following command: 然后要检查此更改是否生效,请运行以下命令:

iptables-save | iptables-保存| grep 8080 grep 8080

Thanks for the response. 感谢您的回复。

This seems to be an issue with the corporate network firewall. 这似乎是公司网络防火墙的问题。 I was able to get the apache tomcat home page when tried from my personal network. 从我的个人网络尝试时,我能够获得apache tomcat主页。

What is weird is that apache http server worked and hence I had ruled out that option. 奇怪的是,Apache HTTP服务器正常工作,因此我排除了该选项。 Seems like they are blocking 8080 only and allowing 80. 好像他们只阻止8080并允许80。

Sorry for the confusion. 对困惑感到抱歉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM