Quick How To: LEMP Server Stack

A super quick way to install Nginx, MySQL, PHP5-FPM on Ubunutu.

sudo apt-get update -y
sudo apt-get install mysql-server php5-mysql -y
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 -y
sudo apt-get install nginx -y
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

Leave a reply