2016 solution
A very good guide can be found from mentioned urls at the bottom.
Here is a breakdown for you,
install mysql
sudo apt-get install mysql-server php5-mysql
Install Apache
sudo apt-get install apache2 libapache2-mod-php5
after installing mysql and apache you should get localhost up and running. Try to check/verify from browser by typing localhost
as a URL. Now, lets get started with WordPress installation.
Installing WordPress
cd /var/www/html
sudo wget http://wordpress.org/latest.tar.gz
sudo tar zxvf latest.tar.gz –strip-components=1
(use sudo) if required.
Then using the sudo command set the permissions so you will be able to modify the files and allow the web server to access them as well like this:
sudo chown -R www-data *
sudo chgrp -R www-data *
After all of this, It's time to create database in mysql, i will show a short way to do it ;)
mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “foopassword”;
mysql> FLUSH PRIVILEGES;
mysql> EXIT
Don't forget to do necessary changes such as username and database name change according to your desire. After doing mysql thing, Rename the wp-config-sample.php file to wp-config.php from your wordpress folder and using your favorite text editor you will need to add the name of your database, mysql username and password to the config file.
If you had follow the instructions correctly, then its your lucky day :)
you can now simply browser your wp site by navigating to localhost/yourfoldername
Reference Urls:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
http://linoxide.com/ubuntu-how-to/ubuntu-apache-php-mysql-wordpress/