Azure-Linux VM Apache Port Troubleshooting
In this Scenario we will cover how to Publish\Troubleshoot a Linux apache Port to external users. (I assume you already installed apache)
- Make sure your binding is set to 0.0.0.0 and not restricted to 127.0.0.1 (by editing the httpd.conf) and verify by netstat -ntlp | grep 80 #port number you set your site.
- Make sure you have allowed an Iptables rule to allow incoming requested for the Port you had set
- If you are just testing disable Iptables to verify Site is working (For Ubuntu sudo ufw enable , For Centos/Redhat 6.x sudo service iptables stop ,For Centos/Redhat 7.x systemctl disable firewalld
- If you site doesn't reside on the defult apache\apache2 locationplease check Selinux (getenforce command)
- you can temporary disable Selinux via the command setenforce 0
- To disabled Selinux you can edit the files /etc/Selinux and set to disable (Centos/Redhat this required a reboot)
- On Ubuntu on Azure the package is not installed by default (selinux-utils)
- after you verify your site is running and security rules are set or disabled you can try to browse the site from another VM running in the same VNET (NSG should be allowing this Port Requests)
- Go to Azure Portal to your VM blade and navigate to the Network -- > NSG --> Open an allow rule to allow incoming traffic depend how you set your apache service.
- Browse from External or use wget or curl command to check the page status.
- You can always look at the syslog\messages logs for more information.
- Or use Fiddler to get a page status.
If this doesn't solve the Problem.
Feel free to raise a ticket for our Azure Support and we will help you out.