Search This Blog

Friday, January 4, 2013

EC2: Access to PHP (Apache) in windows server

My Amazon EC2 is running in Windows 2008 Server R2 with IIS. I can access to aspx pages via Elastic IP http://xxx.xxx.xxx.xxx easily without any problem.

Now i want to have my php application with Apache running in the same server with same IP but port http://xxx.xxx.xxx.xxx:81 to display in the web

There are mainly 3 important steps



  1. Change httpd.config (configuration file for apache)
    Find line with Listen xxx.xxx.xxx.xxx (or localhost) and change to Listen 0.0.0.0:81
    Find line with ServerName  xxx.xxx.xxx.xxx  (or localhost)  and change to ServerName  0.0.0.0:81
    Save the file and restart apache 
  2. Go to windows firewall and add Port 81 in inbound rules
  3. Add Port 81 to EC2 Security Group. Remember to apply the rule after added.

Done. It's work like charm!

No comments: