Https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-7
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
1) Update Apt-get
The apt-get Update command is used to re-synchronize, the package, index files from their sources. If used in combination with the Apt-get Upgrade command, they install the newest versions of all packages currently Availa ble.
At the moment, we have need to do a thorough update:
sudo apt-get update
2) Install MySQL on your VPS
MySQL is a powerful database management system used for organizing and retrieving data
To install MySQL, open terminal and type in these commands:
sudo apt-get install Mysql-server
During the installation, MySQL would ask you to set a root password. If you miss the chance to set the password and the program is installing, it's very easy-to-set the password later from Within the MySQL shell.
Once you has installed MySQL, we should activate it with the This command:
3) Install and Configure Nginx on your vpsinstallation
Initial installation is simple with the Apt-get command.
sudo apt-get install Nginx
Nginx needs a command to begin running:
sudo service nginx start
Configuration
Vim/etc/nginx/nginx.conf, add the following code to the HTTP
server {listen ; Root /opt/app/blog/wz/wordpress/; Index index.php index.html index.htm; server_name iwangzheng.com; Location / {try_files $uri $uri // index.html; } error_page 404/404 . html; Error_page 502 503 504/ 50x.html; Location =/ 50x.html {root /usr/share/nginx/ www; } location ~ \.php$ {try_files $uri =404 ; Fastcgi_pass Unix: /var/run/php5- Fpm.sock; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; } }
The first line of nginx.conf is User www-data;
Modify the permissions of this project directory
sudo chown-r www-data:www-data/opt/app/blog/wz/wordpress/
4) Install and Configure phpinstallation
You probably guessed it! We'll use the apt-get command to install PHP-FPM:
sudo apt-get install php5-fpm php5-mysql
sudo service nginx restartsudo service php5-fpm restart
How to Install Linux, Nginx, MySQL, PHP (LEMP) stacks on Debian 7