えんじんえっくす と呼ばれてるサーバー。これをWebサーバーとして使う。
# apt-get install nginx w3m $ w3m http://localhost/
/var/www/html/ 直下にいる index.nginx-debian.html が実態。バックアップとって、index.html をつくってさしかえてみよう。
pukiwikiいれるにはphp-fpm unzipがいるので、 apt-get install でいれちゃいます。で、w3m なり wget なりでpukiwikiをダウンロード、unzipします。
※Pukiwiki 1.5.3 の時点で対応しているphpは7.4.3になります(Ubuntu 20.04の守備範囲内ですね)。php8系では動かないので注意。
初期状態ではnginxはphpがつかえませんし、pukiwikiを配置したディレクトリ指定しても403エラーになります。
# cd /etc/nginx/sites-available/ # cp default default.org # vi default
index index.html index.htm index.php; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } location ~ /\.ht { deny all; }
前提条件はnginx+PHP...+MySQLなどのDBサーバー、ということでmariaDBいれます。あと、ついでにPHP (mysqlアクセス用のやつ)も。
※mariaDBはMySQLからフォークしてるので使えるはず。
# apt-get install mariadb-server mariadb-client php-mysql
WordPress 本体は本家から tar.gz をダウンロードし、/var/www/html/blog/ といったディレクトリに展開します。
mariaDBがはいったはずなので、DBの作成とDBへのフルアクセスもちのアカウントを作成します。
$ sudo mariadb > CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8; > GRANT ALL ON wordpress.* TO wordpress@localhost IDENTIFIED BY 'password'; FLUSH PRIVILEGES; > \q
あとはblogからアクセスしてDB設定をWeb上から反映すればOKという感じでした。