Create a new instance on you AWS management console. For this how-to I selected 64 bit Amazon Linux (This is the free micro server that amazon offers).
On the Amazon EC2 Console Dashboard click Instances on the sidebar. You will see a list of running instances (you may have to wait for it to start up).
Note the security group that your instance is using and click on Security Groups on the sidebar. Select the security group associated with your instance and add a new rule for http and apply. This will allow web traffic over port 80.
Select the instance you just created and select Instance Actions > Connect. Here you will find instructions on how to connect by ssh.
Once you have connected by ssh run the following installs:
sudo yum -y update sudo yum -y install httpd mysql mysql-server php php-cli php-gd php-intl php-mbstring php-mysql php-pdo php-pear php-xml php-xmlrpc
Make sure services automatically start on a reboot:
sudo chkconfig httpd on sudo chkconfig mysqld on sudo service httpd start sudo service mysqld start
Edit your httpd.conf:
sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.old sudo vi /etc/httpd/conf/httpd.conf
find <Directory "/var/www/html"> and under that change AllowOverride None to AllowOverride All
Press Ctrl + C and type :wq to save and quit.
Restart apache for changes to take effect:
sudo service httpd restart
Set your mysql root password
sudo mysqladmin -u root password 'change-password'
sudo mysql -u root -p mysql> DROP DATABASE test; mysql> DELETE FROM mysql.user WHERE user = ''; mysql> FLUSH PRIVILEGES;
Create the database that drupal will use:
mysql> CREATE DATABASE drupal;
Press Ctrl + C to exit mysql.
Now your server is ready for drupal. I'm going to use drush to install:
sudo pear upgrade sudo pear channel-discover pear.drush.org sudo pear install drush/drush
Next use drush to download the latest drupal version and then move it to the web root directory (Make sure to substitute the the name of the latest distribution for "drupal-7.x")
cd /var/www/html/ sudo drush dl sudo mv drupal-7.x/* ./ sudo mv drupal-7.x/.htaccess ./ sudo rm -r drupal-7.x
Create the files directory and the settings.php file
sudo mkdir sites/default/files sudo chmod 777 sites/default/files/ sudo cp sites/default/default.settings.php sites/default/settings.php sudo chmod 777 sites/default/settings.php
Open your site in a browser and complete drupal install process, your site can be reached at the public DNS listed in your AWS console when you select an instance and should look something like ec2-00-00-000-00.compute-1.amazonaws.com.
After that go back to your terminal and set the permissions on the settings.php file.
sudo chmod 644 sites/default/settings.php
That's it, you should now have the latest version of drupal up and running on your ec2 instance.