Browser the location:http://localhost ; if browser show "Welcome to nginx!", you have installed Nginx successfully;
2. Install PHP
sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5-mysql
Change Nginx site config:
sudo vim /etc/nginx/sites-available/default
change the "index" line to:“index index.html index.htm index.php;”
remove the following comments:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
Test
sudo mkdir /var/www/
sudo vim /etc/nginx/sites-available/default
change root directory to: “root /var/www;”
sudo vim /var/www/test.php
Add the following content to test.php file:
<?php phpinfo();?>
sudo /etc/init.d/nginx restart
http://localhost/test.php
3. Install MySQL
sudo apt-get install mysql-server