#author("2018-06-08T15:51:42+09:00","default:ichinomoto","ichinomoto") #author("2018-06-08T16:38:47+09:00","default:ichinomoto","ichinomoto") * Nginx関連 [#fac74f64] ** Nginx [#c456356e] ***Nginx [#c15ec4ec] cd /usr/ports/www/nginx make install clean /etc/rc.conf nginx_enable="yes" 設定 /usr/local/etc/nginx.conf http { : (略) : include /usr/local/etc/nginx/conf.d/*.conf; #追加 } /usr/local/etc/nginx/conf.d/example.conf 起動 service nginx start ** php設定 [#ff953d27] /usr/local/etc/php.ini cd /usr/local/etc cp php.ini-production php.ini #mysqlを使う場合 pdo_mysql.default_socket=/tmp/mysql.sock に変更 /usr/local/etc/php-fpm.d/www.conf ;listen = 127.0.0.1:9000 を listen = /var/run/php-fpm.socket に変更 listen.owner = www listen.group = www listen.mode = 0660 を有効化 php-fpm有効化 /etc/rc.conf php_fpm_enable="yes" 起動 service php-fpm start **cgi有効化 [#pf17555b] cd /usr/ports/www/fcgiwrap make install clean ** Nginxでのphp有効化 [#v4d97883] ***/usr/local/etc/nginx/nginx.conf [#qc015e87] server { location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; if (!-f $document_root$fastcgi_script_name) { return 404; } # fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php-fpm.socket; fastcgi_index index.php; include fastcgi_params; # upstream sent too big header というエラーログが出るとき用対応 fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param HTTPS on; } }