Raspberry Pi3 Word Press インストールガイド 2


2019年08月01日に投稿
RaspberryPi にWordpressをインストール
WordPress
RaspberryPi
RaspberryPi にWordpressをインストールして初期設定までをメモしてみました。

事前準備
不足している場合は、以下のパッケージを追加で導入します。
・Apache2.4
・mariadb
・PHP7.1

Wordpress から mariaDB へアクセス用のユーザを作成
新規データベースを作成します。
ここでは例として、wordpress という名前で作成しています。

pi@raspberrypi:/var/www/html $ sudo mysql
MariaDB [(none)]> create database wordpress;
新規ユーザを作成します。
設定するパスワード password は、任意のパスワードを指定します。

pi@raspberrypi:/var/www/html $ sudo mysql
MariaDB [(none)]> create database wordpress;

MariaDB [(none)]> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> select user,password,plugin from user;
+---------------------+-------------------------------------------+-------------+
| user                | password                                  | plugin      |
+---------------------+-------------------------------------------+-------------+
| root                |                                           | unix_socket |
| wordpress           | *06B0E0234517A1F1A9BA352FF62B54679CA45F6F |             |
+---------------------+-------------------------------------------+-------------+
2 rows in set (0.00 sec)

MariaDB [mysql]> exit
Bye
先に作成したデータベースに対して新規作成したユーザへアクセス権を付与します。

pi@raspberrypi:/var/www/html $ sudo mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.1.38-MariaDB-0+deb9u1 Raspbian 9.0

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> GRANT ALL on wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

Raspberry Pi 3 に WordPress をインストール
WordPressのモジュールは、こちらからダウンロードできます、
2019/8/1 現在の最新版数は、5.2.2 でした。
インターネットに接続できる環境の場合は、wget コマンドで直接ダウンロードできます。

cd /var/www/html
rm *
wget http://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz
chown -R www-data:www-data /var/www/html
WordPress の初期設定
ブラウザ経由で設定を進めます。

言語設定をします。


事前に作成しておいたデータベースにアクセスする設定を入力します。


インストールを実行します。


管理用のユーザ設定をします。


完了したら、ログインします。


先ほど設定したユーザ、パスワードでログインします。


お疲れさまでした。