Setup nginx php5-fpm on Ubuntu 14.04


ssh root@ip

create droplet
adduser demo

add sudoers
nano /etc/sudoers
# User privilege specification
root    ALL=(ALL:ALL) ALL
demo    ALL=(ALL:ALL) ALL


ssh demo@ip

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install nginx

sudo apt-get install php5-fpm
sudo apt-get install php5-curl
sudo apt-get install php5-mcrypt

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt

#erikaheidi

setup swap
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile
sudo nano /etc/fstab
/swapfile  swap      swap    defaults         0 0


setup php5-fpm
sudo nano /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0

sudo nano /etc/php5/fpm/pool.d/www.conf
listen = 127.0.0.1:9000 to listen = /var/run/php5-fpm.sock


setup nginx
sudo nano /etc/nginx/nginx.conf
uncomment server_names_hash_bucket_size 64;