Nginx+MariaDB+Wordpressを構築
ドメインを取得
mydns.jpでkame.mydns.jpを取得
nginxをインストール
apt install nginx
apacheがインストールされている場合は削除する
apt purge apache2
PHPをインストール
PHP本体とモジュールをインストール
apt install php php-fpm php-mysql php-mbstring php-gd php-json php-cli php-common/
バージョン確認
php -v
PHP 8.2.7 (cli) (built: Jul 20 2023 18:02:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
nginxの設定ファイル編集
vi /etc/nginx/sites-available/kame
書き換え部分
index index.php index.html index.htm index.nginx-debian.html;
追加部分→”php8.2-fpm”の部分は先に確認したバージョンに合わせる
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
参考サイト
RaspberryPiにNGINX+MySQL(MariaDB)+PHPの環境を構築する
https://tsuzureya.net/raspberrypi-nginx-sql-mariadb-php-environment-setup/
RaspberryPi+NGINX環境にWordPressをインストールする方法
https://tsuzureya.net/raspberrypi-nginx-wordpress-setup/
Raspberry Pi (Raspbian)上にNginxを使ったWordPressサーバーを構築する
https://ideal-reality.com/computer/raspberry-pi/rpi-buster-nginx-wordpress/