wordpress を使ってみる

Setup PHP (Ubuntu22.04 + Nginx + mariadb)

apt install php-fpm php-mysql php-mbstring

# socket permission.
vi /etc/php/8.1/fpm/pool.d/www.conf
listen.owner = nginx
listen.group = nginx
listen.mode = 0660

systemctl status php8.1-fpm.service

Nginx conf.

vi /etc/nginx/sites-enabled/site1.conf

location '/wordpress/' {
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    deny all;

    root /home/site1;
    index index.php;
}

location ~ '\.php$' {
    fastcgi_pass unix:/var/run/php/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /home/site1$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
}

wordpress をデプロイ

wordpress.zip をダウンロードして解凍。自分のサイトにFTPアップロード。