upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
root /home/haru/projects/site/web;
index @app;
server_name site.loc;
location / {
try_files $uri @app;
}
location @app {
rewrite ^ index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ \.php$ {
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
sudo apt-get install -y python-software-properties
sudo apt-add-repository -y ppa:ondrej/php5
sudo apt-add-repository -y ppa:nginx/stable
sudo apt-add-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
sudo apt-get install php5-fpm php5-cli php5-mysql mysql-server nginx