tar -xvzf nginx-1.11.8.tar.gz
cd nginx-1.11.8
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make
make install
vim /usr/local/nginx/conf/nginx.conf
Add the following to server section:
listen 80;
server_name domain.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /var/www/html/folder;
index index.php index.html index.htm;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/folder$fastcgi_script_name;
include fastcgi_params;
}
nginx(simple to start) or /usr/local/sbin/nginx
nginx -s stop
sudo yum install php56-fpm
nginx -t to locate config file
service php-fpm start/stop/restart
vim /etc/php-fpm.d/www.conf -> change user and group
vim /etc/php-fpm.conf
No comments:
Post a Comment