Make a note.
# Nginx. conf
Server {
Listen 8080;
Server_name localhost;
Location /{
Root/home/work/htdocs;
Expires 1d;
Autoindex on;
Index. php index.html;
}
Location ~ * \. Php $ {
Root/home/work/htdocs;
Fastcgi_pass 127.0.0.1: 30000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/home/work/htdocs/$ fastcgi_script_name;
Client_max_body_size 100 m;
Include fastcgi_params;
Fastcgi_connect_timeout 1000 s;
Fastcgi_send_timeout 1000 s;
Fastcgi_read_timeout 1000 s;
}
}
# Nginx. sh ngix Startup Script
#! /Bin/sh
Case "$1" in
'Start ')
Sudo/usr/local/nginx/sbin/nginx-s start
;;
'Stop ')
Sudo/usr/local/nginx/sbin/nginx-s stop
;;
'Restart ')
Sudo/usr/local/nginx/sbin/nginx-s reload
;;
*)
Echo "Usage: $0 {start | stop }"
Exit 1
;;
Esac
# Spaw-php.sh php-cgi Startup Script
#! /Bin/sh
Dir = 'dirname $0'
PID_FILE =/home/work/htdocs/spaw-php.pid
PHP_FCGI = "/home/work/php/bin/php-cgi-f/home/work/htdocs/php. ini"
Case "$1" in
'Start ')
Spawn-fcgi-C 3-p 30000-f "$ PHP_FCGI"-P $ PID_FILE
;;
'Stop ')
Kill 'cat $ PID_FILE'
;;
'Restart ')
Kill 'cat $ PID_FILE'
Spawn-fcgi-C 3-p 30000-f "$ PHP_FCGI"-P $ PID_FILE
;;
*)
Echo "Usage: $0 {start | stop }"
Exit 1
;;
Esac
From ideawu