Nginx stand-alone configuration
Http://tengine.taobao.org/book/index.html (Taobao book)
http://ubuntuhandbook.org/index.php/2013/10/install-nginx-php5-mysql-lemp-ubuntu-1310/(Nginx+php5+mysql)
http://blog.csdn.net/hursing/article/details/21527159 (English)
: Questions about several commands:
sudo apt-get install mysql-server mysql-client
sudo apt-get install Nginx
sudo apt-get install PHP5-FPM
: PHP only needs to use PHP5-FPM
: Configure your own server, directory, etc., support thinkphp, directory for/home/ftp:
Open: sudo vim/etc/nginx/sites-available/default
server {
Listen default_server;
Listen [::]:80 default_server Ipv6only=on;
Root/home/ftp;
Index index.html index.htm index.php;
server_name localhost;
Location/{
if (!-e $request _filename) {
Rewrite ^ (. *) $/index.php?s=$1 last;
Break
}
}
Location ~* \.php$ {
Fastcgi_pass Unix:/var/run/php5-fpm.sock;
Fastcgi_index index.php;
Include Fastcgi_params;
Set $path _info "";
Set $real _script_name $fastcgi _script_name;
if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") {
Set $real _script_name $;
Set $path _info;
}
Fastcgi_param script_filename $document _root$real_script_name;
Fastcgi_param script_name $real _script_name;
Fastcgi_param path_info $path _info;
}
Nginx + PHP +mysql (suitable for thinkphp)