nginx の設定

インストール
# pacman -S nginx
# pacman -S php-fpm
# pacman -S fcgiwrap
nginx の起動
# systemctl start nginx

/usr/share/nginx/html/index.html が表示される。

/etc/php/php.ini の設定

open_basedir = /var/www/:/var/tmp/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/
/etc/nginx/nginx.conf の設定

unix socket を調べる

$ grep listen /etc/php/php-fpm.d/www.conf | grep php-fpm
listen = /run/php-fpm/php-fpm.sock
location ~ \.php$ {
root /var/www;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}

location ~ \.py$ {
gzip off;
fastcgi_pass unix:/run/fcgiwrap.sock;
fastcgi_index index.py;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
}

/etc/php/php-fpm.conf の設定

listen = /run/php-fpm/php-fpm.sock
再起動

# systemctl restart php-fpm
# systemctl restart fcgiwrap.socket
# systemctl restart nginx
fcgiwrap

# systemctl start fcgiwrap.socket
# systemctl enable fcgiwrap.socket
Return

May/20/2018 AM 08:15