Open d-shimizu opened 2 years ago
$ sudo systemctl stop isu-ruby
$ sudo systemctl start php7.4-fpm
$ unlink /etc/nginx/sites-enabled/isucon.conf
$ sudo ln -s /etc/nginx/sites-available/isucon-php.conf /etc/nginx/sites-enabled/isucon.conf
/etc/php/7.4/fpm/pool.d/www.conf
;listen = /run/php/php7.4-fpm.sock ;listen = 127.0.0.1:9000 listen = 0.0.0.0:9000
/etc/nginx/sites-available/isucon-php.conf
upstream php-fpm { server 127.0.0.1:9000; server 10.128.1.7:9000; server 10.128.1.240:9000; }
server { listen 80;
client_max_body_size 10m; root /home/isucon/private_isu/webapp/public; location / { try_files $uri /index.php$is_args$args; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php { root /home/isucon/private_isu/webapp/php; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_index index.php; #fastcgi_pass 10.128.1.7:9000; fastcgi_pass php-fpm; }
}
ruby 実装停止
php-fpm 実装起動
Nginx 設定変更
複数台とする場合
/etc/php/7.4/fpm/pool.d/www.conf
/etc/nginx/sites-available/isucon-php.conf
server { listen 80;
}