I'm going to use one of the base install Ubunty Hardy AMI created by alestic as the Linux foundation. Start up ElasticFox and in the available Machine Images (AMIs) list, select the base Ubuntu Hardy AMI with ID ami-6a57b203 (alestic/ubuntu-8.04-hardy-base-20080517.manifest.xml), and select Launch Instance(s) of this AMI.
Make sure that you've created a keypair for SSH authentication. If not, have look at the get start guide here. Select the appropriate keypair in the next window, and launch the instance. It may take a few minutes for the instance to run (keep refreshing the Your Instances section).Once the instance state changed to running, SSH to the instance's public DNS as shown below using puTTY.
You should see something like the window below.
On your instance's command shell, enter the following command to begin installation of the LAMP server, and follow through the on screen instructions.sudo tasksel install lamp-server
Once that is completed, let's enable mod rewrite to support pretty URL.
a2enmod rewrite
Let's first update the apt-get application
apt-get update
Install phpmyadmin with the following command.
apt-get install phpmyadmin
You need at least one text editor application. My favorite one in Linux is emacs. Use the following command to install emacs.
apt-get install emacs22
To setup phpmyadmin under apache all you need to do is include the following line in /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf
If you use emacs to edit the file, use the command below to open the file in the text editor
emacs /etc/apache2/apache2.conf
Make the necessary changed in emacs, the use Ctrl X-S to save the file, and then Ctrl X-C to close.
This is optional, but I use php curl library in some of my work. So I would like to install the library using the following command
apt-get install php5-curl
Now, we can restart apache.
/etc/init.d/apache2 restart
Let's try out our newly installed webserver and phpmyadmin. Get your instance public DNS, and append phpmyadmin at the end. Open the address in your web browser. For example
http://ec2-67-202-12-202.compute-1.amazonaws.com/phpmyadmin
Congratulations!!! Your LAMP installations is working if you can see the welcome page of phpmyamin. You can use phpmyadmin to manage your mySQL database (add users, create databases etc). Just remeber your mySQL root password that you specified during the installation.

Lastly, you need to save your LAMP instance and create your own machine image (AMI). Refer to the getting started guide if you don't know how to do this.
If you would like to go further by configuring a LAMP cluster with load balancer, have a look at my cluster with load balancer guide here.

7 comments:
Huge, I mean, HUGE, it would have taken me a few weeks to figure all that out. Would you say that an ftp server would be the most efficient way to get a set of application files to the server? Or is there something I'm missing?
Well, there's a few method you can transfer files to the instance server. I use SCP mainly to do that from my PC. And for transfering from Amazon S3, I'm using s3sync. To install application, use apt-get or wget. Cheers.
Seriously - Thanks!
First I read your EC2 post, and then this. You have no idea how much time and pain you have saved me with these excellent postings. You should keep doing this as you are better at it than 99% of the other ones out there. Thank you!!
Please continue your good articles on scaling php/mysql web applications using amazon web services framework.
i have been going reading everything on lamp installs and this is the best!
Can you do one on adding FTP and security?
Thanks again!
EVEN by wow gold the standards gold in wow of the worst financial buy wow gold crisis for at least wow gold cheap a generation, the events of Sunday September 14th and the day before were extraordinary. The weekend began with hopes that a deal could be struck,maplestory mesos with or without government backing, to save Lehman Brothers, America''s fourth-largest investment bank.sell wow gold Early Monday buy maplestory mesos morning Lehman maplestory money filed for Chapter 11 bankruptcy protection. It has more than maplestory power leveling $613 billion of debt.Other vulnerable financial giants scrambled maple money to sell themselves or raise enough capital to stave off a similar fate. billig wow gold Merrill Lynch, the third-biggest investment bank, sold itself to Bank of America (BofA), an erstwhile Lehman suitor,wow power leveling in a $50 billion all-stock deal.wow power leveling American International Group (AIG) brought forward a potentially life-saving overhaul and went maple story powerleveling cap-in-hand to the Federal Reserve. But its shares also slumped on Monday.
Post a Comment