简体   繁体   中英

Azure Centos Tomcat deployment

I spun up Azure Centos 7 VM. Downloaded and installed tomcat apache server 7. When I run curl http:// localhost:8080 it displays the html file.

When I try to access it from my desktop as http:// ext_ipaddress:8080/, it fails "This site can't be reached"

when I do telnet from my desktop telnet ext_ipaddress 8080, it fails

"Could not open connection to the host, on port 8080: Connect failed"

When I do telnet ext_ipaddress 80 it displays a blank screen which I assume is success.

Firewall is not running on the VM and when I sudo netstat -lnp

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

I dont see port 80 listening anywhere.

I have attached the NSG:

非政府组织

[Update]

I tried installing only Apache webserver and was able to access apache HTTP server page from my desktop with http://ext_ipaddress

Normally, this issue may be caused by the misconfigured local firewall. (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.

If the packets from client are captured, it means that Azure doesn't block the connection. Then you should check if there is anything on the VM blocking the connection. The most common cause is iptables.

Please try to run the following command to open the TCP port 8080.

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

firewall-cmd --reload

Then to check if this change takes effect, please run the following command:

iptables-save | 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.

What is weird is that apache http server worked and hence I had ruled out that option. Seems like they are blocking 8080 only and allowing 80.

Sorry for the confusion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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