I was pretty excited about installing and booting up EC2 instance of my own. It really was a painless process where you just have to click on couple of buttons on AWS management console. The power of cloud was within my reach and I was salivating when I typed in http://[elastic ip-address of my EC2 instance] in the browser.
Wait, something has gone wrong. Terribly terribly wrong.
Instead of apache introduction page, I was greeted with unable to connect error page.
Oh what a horror. I felt sick from the bottom of my stomach. The illusion of magic has been washed down the drain and I was left with naked error page that felt cold in bitter space of nothingness.
Lesson for people who just started their first EC2 instance: Their is no magic. You still have to say the magic words yourself. Luckily commands for linux system actually sound quite like arcane magic. In order to get your LAMP server going, the magic word you have to utter is: YUM.
yum install httpd
yum install php
yum install mysql-server mysql
Type in above magic phrases to install apache, php and mysql on your EC2 instances. Then finally utter below words to complete your magic spell:
service httpd start
service mysqld start
Now you can point your favorite browser to http://[elastic ip-address for EC2 browser] and marvel at the apache welcome page! Cloud is a beautiful thing. *tears*
You may notice that httpd service does not start automatically when you reboot your EC2 instance, which can be annoying since you have to start httpd manually every time you reboot it. So when you are in the mood for some more magic casting, say below words:
chkconfig httpd --add
chkconfig httpd on --level 35
Then when you restart your EC2 instance, apache welcome page will greet you happily ever after~ =)
Yum yum yum