Hosting Apache and WAMP Websites on Azure Cloud

After installing Apache, or a WAMP server such as WampDeveloper Pro, in a Windows VM on Azure Cloud, you’ll need to connect that VM to port 80 and also open internet access to Apache.

Create Endpoints for Port 80 and 443

Azure needs to have its “port endpoints” set up to be able to forward incoming port 80 and 443 traffic to the right VM (and the right port in the VM).

Create new endpoints from Public:80 to Private:80 (and the same for port 443). Don’t select/check-mark ‘Create load-balancing set’, nor ‘Enable direct server return’, unless you are running multiple VMs and want the traffic to be split between them for these ports.

Virtual Machine > Endpoint > Add endpoint > Next > name:http, protocol:tcp, public port:80, private port:80 > click Complete

How to Set Up Endpoints to a Virtual Machine

Configure Windows Firewall To Open Port 80 and 443

Windows Firewall blocks, by default, incoming port 80 (HTTP) and 443 (HTTPS) requests, for Protocol TCP and UDP. You’ll need to create Inbound Rules to open these ports.

Note that:

  • If IIS was installed previously, the existing port 80 and 443 rules might only be in effect for IIS. Delete them and create new rules for general port 80 and 443 use.
  • Check for any blocking rules automatically created for the Apache httpd.exe program, they will be named as such (Apache HTTP Server).
  • Every time you update/change Apache versions, the Windows Firewall will attempt to create a new blocking rule for it.

Clear Access Control List Rules

Select port 80 and 443 Endpoints and click ‘Manage ACL’. Delete any rules present (you do not need them for a publicly accessible website).

Other

* It might take 10 minutes for endpoint changes to take effect in the system.

* Before installing or running Apache on Azure, make sure that IIS is uninstalled, or at least that its Service is stopped and its Startup Type changed from “Automatic” to “Manual” or “Disabled”. Apache and IIS are both configured (by default) to bind-to/listen-on ports 80 and 443 on all IPs, and unless they are bound to different IPs or on different ports, they will not be able to run at the same time (side-by-side).

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>