LoginSignup
32
48

More than 3 years have passed since last update.

Ubuntu 18.04 LTS に WordPress 5.3 をインストール

Last updated at Posted at 2019-03-06

Ubuntu にLAMP(Linux/Apache/MariaDB/PHP)環境のインストールを行う手順を以下に記します。

タイムゾーンの変更

sudo su - 
timedatectl set-timezone Asia/Tokyo

Apache のインストール

apt -y update
apt -y install apache2 
systemctl enable apache2
systemctl start apache2

webブラウザで Ubuntu 18.04 サーバのIPアドレス(curl ifconfig.meで確認できます)にアクセスして Apache のテストページが表示されるか確認します。

image.png

PHP 7.2 のインストール

apt -y install php7.2 php7.2-mysql

MariaDB 10.1 のインストール

apt -y install mariadb-server mariadb-client
systemctl enable mariadb
systemctl start mariadb

2019-09-24 時点では MariaDB 10.1.41 がインストールされました。


$ sudo mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 97
Server version: 10.1.43-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

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)]>

WordPress のインストール

WordPress ダウンロード/展開

現時点でのWordPress最新版をダウンロードし、DocumentRoot配下に展開します。

cd /var/www/html
wget https://ja.wordpress.org/latest-ja.tar.gz
tar xvf latest-ja.tar.gz
chown -R www-data:www-data .

WordPress 用データベース作成

文字コードUTF8でデータベース wordpress を作成します。


$ sudo mariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 99
Server version: 10.1.43-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

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)]> CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)

WordPress 用 MariaDB ユーザの作成

さきほど作成したデータベースのみ全権限を持つ wordpress ユーザを作成します(ユーザ名/パスワードは適宜変更してください)。

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

WordPress 初期設定

webブラウザで xx.xx.xx.xx/wordpress にアクセスし、WordPressの初期設定を行います。

image.png

image.png

正常にインストールが完了すると、指定したユーザ、パスワードでダッシュボードにログインできます。

image.png

image.png

32
48
1

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
32
48