Quick Reference LEMP Stack Install with PHP on Ubuntu

Really quick list of commands for setting up a LEMP stack, assuming you already have experience.

sudo apt-get update
sudo apt-get install mysql-server php5-mysql
sudo /usr/bin/mysql_secure_installation
echo "deb http://ppa.launchpad.net/nginx/stable/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/nginx-stable.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
sudo apt-get update
sudo apt-get install nginx
sudo service nginx start
sudo apt-get install php5-fpm
sudo nano /etc/php5/fpm/php.ini
# Change this line!
cgi.fix_pathinfo=0
sudo nano /etc/php5/fpm/pool.d/www.conf
# If listen is set to use a port, change it to use a socket.
listen = /var/run/php5-fpm.sock
sudo service php5-fpm restart