Skip to main content

Apache on an Amazon EC2 Ubuntu instance

Apache on an Amazon EC2 Ubuntu instance

I'm refreshing myself on how to make web sites that aren't PHP-CMS-on-Pantheon this week in preparation for a new job.

Launch an Amazon EC2 Virtual Machine. For this, I chose Ubuntu Linux. When the launcher told me that everyone could access my instance, I set SSH to only allow my IP address, and set HTTP and HTTPS to everyone.

ssh -i ~/.ssh/MyKeyPair.pem ubuntu@{EC2 IP_Address}

While ssh'd into your instance, install Apache.

In a browser, load your EC2 instance IP address. You should see the default Apache web page!

You can edit /var/www/html/index.html with nano while ssh'd in, but I like to manage files with a GUI. In FileZilla, open the site manager. Add your EC2 IP address and pem file. Your username will depend on what kind of Linux you chose when you set up your instance (my username was ubuntu). You should be able to navigate to /var/www/html and see index.html, which you edit to change that default Apache web page. Hooray!