Creating An Amazon EC2 Instance With Linux Lamp Stack

Posted on June 26, 2011 by Anthony James Founder/CEOAnthony James Founder/CEO

In this screencast you will learn how to use Amazon EC2 (Elastic cloud compute). We will install a debian instance, connect to it with SSH and install our LAMP stack.




Amazon ec2 instance id used: ami-b26c9fdb
Software installed for lamp stack:
#apt-get update
#apt-get install mysql-server mysql-client libmysqlclient15-dev
#apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
#apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-mcrypt php5-mysql php5-ps php5-pspell php5-recode php5-xsl
#apt-get install phpmyadmin

9 Comments

Image of Drake
Drake
8 years ago

This was a great tutorial. This was my third time trying to get an EC2 instance up and only my first successful attempt. Seems like it wouldn’t be that hard but with the plethora of AMI’s it just isn’t that straight forward for a n00b like myself.
Now if you can show me how to EASILY create an FTP connection…

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

I’d be happy to create a tut for you if you would like. I’ll try and do that tonight.

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

Also, so you know if you just instal openssh-server and adduser. You can connect to sftp with filezilla. Just use your host name, the username and password, and port 22

Image of Drake
Drake
8 years ago

Funny I actually was able to get in using FileZilla/SFTP using the converted keypair as root. I would like to know how to create users/passwords however so that others could connect via port 21.
I do have a question. After following all the steps above I am able to view the index.php page fine but when I try to access phpmyadmin I get a 404. I tried finding phpmyadmin setting info but the articles I’ve found don’t seem to relate to this install. What am I doing wrong?

Reply
Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

Do you have a /etc/phpmyadmin? If not, you might try re-doing the apt-get install phpmyadmin
Make sure you’ve done apt-get update as well.
I’m working on a screencast for this evening that will show you how to create username/passwords for others to connect to your box with.

Image of Drake
Drake
8 years ago

It looks like the issue was that the phpmyadmin apache alias isn’t being auto-created. I was able to create it in the sites-enabled folder and now it works. Looking forward to the new tut!

Reply
Image of Trevor
Trevor
8 years ago

FYI on this image you’ll probably need to follow the post below to successfully run an apt-get upgrade:
http://www.sysadmintalk.net/forums/Thread-PyGrub-grub-probe-can-t-find-drive-for-dev-xvda1-error-Debian-Squeeze

Image of jaffe
jaffe
8 years ago

And for you Windows users you can get win-get here
http://windows-get.sourceforge.net/index.php

Image of andrewpsp
andrewpsp
8 years ago

Can’t help but notice you went at blazing speed during the creation of the index.php file
I create the index.php file just as you did.
Looking so clean so far, now I ^X and hit Y to write the changes using nano(new)
What did you do afterwards to call the details at 10:42?

Image of andrewpsp
andrewpsp
8 years ago

echo index.php to no avail

Reply
Image of Rob
Rob
7 years ago

Total Linux noob here. When I searched for the AMI ami-b26c9fdb it doesn’t show up in the list of available AMIs. Is it just out of date and removed from the list?
For a basic LAMP stack, which AMI should I use? How do decide which AMI is best if I am just starting out with Linux? I’m not sure what features or platform I should look for. Debian, Ubuntu, Red Hat? There are so many AMIs to choose from and I don’t know what to look for.

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
7 years ago

AMI availability can change from time to time. Just search for a Debian instance.

Reply
Image of Brandon
Brandon
6 years ago

I’m using a linux server and the apt-get is not working to install apache.

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
6 years ago

Check out linuxacademy.com also sounds like you might be on a linux server. does yum install http work?

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *