I have tested the following steps on Amazon EC2 with Ubuntu 14.04
Here is a summary of command lines to install LAMP technology stack (before installing wordpress):
1: Install LAMP technology stack
Update linux
#> sudo apt-get update
-> update package repositories information
#> sudo apt-get upgrade
-> install package upgrades
Install apache2
#> sudo apt-get install apache2
Install php
#> sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
Install mysql
#> sudo apt-get install mysql-server php5-mysql
Install phpmyadmin
#> sudo apt-get install phpmyadmin
In case thing went wrong, remove installed package and its configuration file(s)
#> sudo apt-get purge package_name
Once the stack is installed here is the steps to complete wordpress installation:
2: Install WordPress
wget https://wordpress.org/latest.zip
sudo mkdir /var/www/wordpress
Move zip file into /var/www/wordpress and extract.
cd /etc/apache2/sites-available/
sudo cp 000-default.conf wordpress.conf
Modify wordpress.conf so apache2 knows to forward any request or your domain to the wordpress app folder.
sudo a2ensite wordpress.conf
sudo service apache2 restart
Go to PhpMyAdmin via your browser by youdomain.com/phpmyadmin .
Create a new user “wordpress” and check to create the corresponding database.
cd /var/www/wordpress
sudo cp wp-config-example.php wp-config.php
Modify config file to add your MySQL wordpress database information.
sudo chown -R www-data:www-data /var/www/wordpress
sudo chmod -R 755 /var/www/wordpress/
Open browser and type in your domain. You should see the WordPress installation page. Follow the instruction and you are done!