:::: MENU ::::

Setting up Apache and PHP on Amazon EC2

You can tell by today’s posts that I’m getting something started on EC2. You can also read what’s already installed on the free instance or how to get started. PHP and MySQL are not installed on the free instance, so this post is about getting setup so I can run 140dev’s excellent Twitter Database Server.

First, let’s update yum

sudo yum -y update

Then we install PHP and Git (Git will come in handy later, and I don’t need MySQL so won’t be installing it):

sudo yum install php
sudo yum install php-mysql
sudo yum install git

Apache’s already installed but isn’t started. To start it

sudo service httpd start

By default, the DirectoryRoot is /var/www/html, and I’m leaving it that way. Put a dummy index.html file in that location. Then, make sure you have port 80 open on your instance (see below) and go to your elastic IP in your browser. Here’s mine:

http://50.19.246.137

Opening Port 80

  1. In the AWS Management Console, under Security Groups, select the group that’s associated with the instance you’re running.
  2. Click on “Inbound” in the properties window.
  3. Select “HTTP” from the “Create a new rule” dropdown.
  4. Enter 0.0.0.0/0 as the source to allow all web traffic to see your site.

2 Comments

So, what do you think ?

You must be logged in to post a comment.