17
20

More than 1 year has passed since last update.

CentOS 7 に WordPress 5.8 をインストール

Last updated at Posted at 2019-03-06

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

タイムゾーンの変更

sudo su - 
timedatectl set-timezone Asia/Tokyo

Apache のインストール

yum -y install httpd
systemctl enable httpd
systemctl start httpd

webブラウザで CentOS 7 サーバのIPアドレスにアクセスして Apache のテストページが表示されるか確認します。

image.png

PHP のインストール

yum -y install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install --enablerepo=remi,remi-php74 php php-devel php-mbstring php-pdo php-gd php-mysqlnd
systemctl restart httpd

MariaDB 5.5 のインストール

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

2020-07-24 時点では MariaDB 5.5.65 がインストールされました。

[root@centos7 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.65-MariaDB MariaDB Server

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 5.x ダウンロード/展開

最新版 WordPress 5.x をダウンロード、DocumentRoot 配下に展開します。

yum -y install wget
cd /var/www/html
wget https://ja.wordpress.org/latest-ja.tar.gz
tar xvf latest-ja.tar.gz
chown -R apache:apache .

WordPress 用データベース作成

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

[root@centos7 html]# mysql

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

17
20
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
17
20