# apt install nginx-fullディフォールトのページii nginx-full 1.12.1-0ubuntu2 amd64 nginx web/proxy server (standard version)
/usr/share/nginx/html/index.html /etc/nginx/sites-available/default で定義されている。Perl-FastCGI on Ubuntu PHPを使えるようにする。 php8.3-fpm (FastCGI Process Manager) を使う。 参考になるページ
root /usr/share/nginx/html;
Debian(jessie)にPHP 7をインストールする方法必要なパッケージのインストール
# apt install php php-fpm
root /var/www; に変更する スタートページは、/var/www/index.html になる。/etc/php/php-fpm.d/www.conf# location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.3-fpm.sock; }/etc/php/8.3/fpm/pool.d/www.conf に
listen = /run/php/php8.3-fpm.sock となっている
security.limit_extensions = .php .php3 .php4 .php5 .php7 .html
# systemctl restart php8.3-fpmnginx の再起動
# systemctl restart nginx設定ファイルのチェック
sudo nginx -tPHPで、アップロードできるファイルのサイズの上限を 512M にする。
/etc/nginx/sites-available/defaultlocation ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_pass unix:/var/run/php7.3-fpm.sock; fastcgi_index index.php; include fastcgi_params; client_max_body_size 512M; }/etc/php/7.3/fpm/php.inipost_max_size = 512M
upload_max_filesize = 512M
ii fcgiwrap 1.1.0-10 amd64 simple server to run CGI applications over FastCGIデフォールトで、 /var/run/fcgiwrap.socket が使われる。 /etc/nginx/sites-available/default への設定の追加fcgiwrap の再起動location ~ \.pl$ { gzip off; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.pl; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }# systemctl restart fcgiwrap
# systemctl restart nginx
location ~ \.py$ { gzip off; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.py; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
location ~ \.rb$ { gzip off; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.rb; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
location ~ \.sh$ { gzip off; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.sh; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
/etc/nginx/sites-available/defaultパラメーターの確認方法
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
root /var/www;
index index.html index.htm;
autoindex on;
# apt-get install phpmyadmin cd /var/www ln -s /usr/share/phpmyadmin/ .
/etc/nginx/nginx.confBasic 認証 Let's Encrypt
# charset UTF-8 をコメントアウト
rtmpserver { location /tomcat { proxy_pass http://localhost:8080/; proxy_set_header X-Forwarded-For $remote_addr; } }
Jun/14/2025 AM 08:00