Skip to content
Advertisement

Unable to access apache page on Linux Azure VM

I’ve setup a linux VM in Azure. I’ve added incoming port access to the current listening port on Apache. I’ve also done a curl localhost on the VM and see the apache html text. I hit the public IP of the VM and get nothing. Any ideas?

Advertisement

Answer

According to your description, please check those settings:
1. Please check Azure VM’s NSG settings, make sure we have add port to inbound rules:enter image description here 2. Vnet–>subnet’s security group settings: enter image description here 3. Check which port apache listening on: netstat -ant

JavaScript

By the way, for test please disable ufw with this command ufw disable, then try to access the public IP address.

Update:
I follow those steps to modify apache default port:
1.Modify ports.conf, change port 80 to 80:

JavaScript

2.Add ServerName localhost to /etc/apache2/apache2.conf

JavaScript

3.Modify default port in /etc/apache2/sites-enabled/000-default.conf

JavaScript

4.Add inbound rule to Network Security Group: enter image description here

By the way, to troubleshoot this issue, we can follow those steps:
1.Login this VM and use curl to test apache2:

JavaScript

2.Use your PC to telnet this VM’s public IP and port 90

JavaScript

If you can’t telnet this port, please check your NSG settings and subnet’s security group settings.

Here is my result, it works for me:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement