Sunday, May 19, 2013

Installing apache on your EC2 instance

This is very simple!

Installing apache


Open up putty and ssh into your ec2 machine.

Run this:
$ sudo yum -y install httpd

Start the service -
$ sudo service httpd start

You should see a status message that says OK.

Next, navigate in the browser to your EC2 machine.

To get that url go to your ec2 management console, and copy the url shown below.













You should see a generic page shown. If you tried to use this url before you'd be staring at a 404 page!

Uploading web pages

The http web folder has a path of /var/www/html
By default you cannot write to this location!

To take ownership of this folder, connect with putty ssh. And run this command:
$sudo chown -R ec2-user /var/www/html 

After you take ownership of this folder, then you can copy files to this location. I recommend using winSCP to copy files.

Files you copy to this location, will show up using the ami url and the filename. Slick eh?

No comments:

Post a Comment