- Sign up with Amazon and EC2
- Select your AMI at http://uec-images.ubuntu.com/releases/lucid/release/ and click on the relevent hyperlink to jump straight into the Amazon EC2 console and the instance launch wizard.
- Follow instructions in the wizard
- Download your pem file (if this is your first instance)
Manage your Key File/Make compatible with Putty for SSH connection (if this is your first instance)
- Open puttygen
- click 'load' and browse to your .pem file (may need to browse for 'all files')
- click ok when successfully imported
- update the comment, set a passphrase if you wish (do not do so if you wish to use filezilla to copy files to your server - more about this later) and click 'save private key' to save your key as a ppk file.
- click ok to the warning if you haven't set a passphrase
- close puttygen
Configure inbound ports to your instance in the EC2 console
- Navigate to 'Security Groups', click on your security group and edit the inbound port configuration.
- Add rules
- 22 -SSH
- 80 - HTTP
- then click 'apply rule changes'
Get instance details for SSH connection
- Navigate to 'Instances' in the EC2 console, right click on your instance and click 'connect'
- Note the command line and copy the section root@ec2<...>com to the clipboard
Make the SSH connection
- open putty
- paste the address into the host name box and replace 'root' with 'ubuntu'
- Select Connection -> SSH -> Auth and browse to your ppk file
- click 'open' to start the connection
- click yes to add the server's host key to putty's cache
- enter your passphrase if prompted
Update Ubuntu Package repositories (before you install anything)
- sudo apt-get update
Install LAMP server software
- I found the instructions at http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/ useful, but when testing apache remember to use the host name of your amazon instance instead of localhost
- I also chose to install phpmyadmin
phpMyAdmin Security (Allow from 127.0.0.1 only - we will use an SSH tunnel to connect)
- type the following command to edit the phpmyadmin apache configuration
- sudo nano /etc/phpmyadmin/apache.conf
- Enter the following in the <directory> configuration
- Order Allow,Deny
- Allow from 127.0.0.1
- ...then save and exit
- Further information at http://nicholaspier.com/2010/07/securing-phpmyadmin-on-ubuntu-10-04/
Copying files to your server with filezilla
- Enter your server name ec2<...>com in the host box, prefixed with sftp://
- Set the username to 'ubuntu'
- Click Edit -> Settings ->Connection -> SFTP
- Click add keyfile and browse to your ppk file (without passphrase)
- Click OK to close the dialogue box and then 'Quick Connect'
- You can now copy files to the ubuntu user home directory
- If you need help configuring apache I found the following links useful
- You'll probably want to enable apache's mod_rewrite (to rewite clean/SEF URLs)
- sudo a2enmod rewrite
- ...and install APC (php caching for performance gains)
- sudo apt-get install php-apc
- then restart apache with sudo /etc/init.d/apache2 restart
- sudo apt-get install php-apc