For detail look here
sudo apt-get install nginx
then get IP address and try it on browser
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
sudo apt-get install mysql-server mysql-client
then create mysql directory structure
sudo mysql_install_db
sudo apt-get install php5-fpm php5-mysql
then configure php processor by editing /etc/php5/fpm/php.ini
file with changing the value of cgi pathinfo like this-
cgi.fix_pathinfo=0
then restart php
sudo service php5-fpm php5-cli restart
edit /etc/nginx/sites-available/default
file like this-
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name server_domain_name_or_IP;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
then restart nginx
sudo service nginx restart
after that test php by creating a file named /usr/share/nginx/html/index.php
and edit it like this-
<?php
phpinfo();
and then show in browser.