How To Host Multiple Websites Securely With Nginx And Php-fp
發表於 : 2016-04-10 15:43:53
https://www.digitalocean.com/community/ ... untu-14-04
/etc/php5/fpm/pool.d/site1.conf
/etc/nginx/sites-available/site1
/etc/php5/fpm/pool.d/site1.conf
代碼: 選擇全部
[site1]
user = site1
group = site1
listen = /var/run/php5-fpm-site1.sock
listen.owner = www-data
listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
代碼: 選擇全部
server {
listen 80;
root /usr/share/nginx/sites/site1;
index index.php index.html index.htm;
server_name site1.example.org;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-site1.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
代碼: 選擇全部
sudo service php5-fpm restart
sudo service nginx restart