LoginSignup
4
3

More than 3 years have passed since last update.

Raspberry Pi zero(Raspbian Buster)にwordpress をインストールしました。

Last updated at Posted at 2019-11-05

Raspberry Pi zero(Raspbian Buster)にwordpress をインストールしました。

Raspberry PiでLXTerminalを開き、以下のコマンドを入力してEnterキーを押します。

0.updateします

sudo apt-get update
sudo apt dist-upgrade

1.Apacheをインストールします

sudo apt-get install apache2 -y

2.PHP7.3をインストールします

sudo apt-get install php7.3

関連をインストールします

sudo apt-get install php7.3-fpm
sudo apt-get install php7.3-mysql
sudo apt-get install php7.3-mbstring
sudo apt-get install php7.3-gd
sudo apt-get install php7.3-zip
sudo apt-get install php7.3-xml
sudo apt-get install apache2-mod-php7.3

3.MySQLをインストールします(mariadb)

sudo apt install mariadb-server

4.mySQLにログインします

sudo mysql -u root -p

パスワードをもとめられますがそのまま Enter します
WordPressで使用するDBを作成します。(DB名 例として wordpress)

CREATE DATABASE wordpress;

wordpressというDBを操作するユーザーに権限を付与します。(ID user パスワード user)

GRANT ALL PRIVILEGES ON wordpress.* TO 'user'@'localhost' IDENTIFIED BY 'user';

終了します

quit

5.WordPressをインストールします

sudo wget https://ja.wordpress.org/latest-ja.tar.gz`

解凍します

sudo tar xvfz latest-ja.tar.gz`

設定します

cd wordpress/
sudo cp wp-config-sample.php wp-config.php
sudo chmod 600 wp-config.php

wordpressの設定をします エディタleafpad

sudo leafpad wp-config.php

define('DB_NAME', '<span class="rmarker">データベース名</span>');
define('DB_USER', '<span class="rmarker">ユーザ名</span>');define('DB_PASSWORD', <span class="rmarker">パスワード</span>');

を以下に変更します データベース名 wordpress  ユーザー名 user パスワード user

define('DB_NAME', '<span class="rmarker">wordpress</span>');
define('DB_USER', '<span class="rmarker">user</span>');define('DB_PASSWORD', '<span class="rmarker">user</span>');`

WordPressのディレクトリを外部公開用のディレクトリへ移動し、所有者・グループをapachのユーザーに設定します。

cd ..
sudo mv wordpress/ /var/www/html/
sudo chown -R www-data:www-data /var/www/html/wordpress

6.ここでapache2を再起動します

sudo apache2ctl restart

7.ブラウザを立ち上げて、以下のURLをアドレスバーに入力してEnterキーを押します。

http://Raspberry PiのIPアドレス/wordpress/wp-admin/install.php

これで動きました

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3