LoginSignup
46
39

Ubuntu 22.04 LTS に WordPress 6.2 をインストール

Last updated at Posted at 2020-11-02

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 20.04 サーバのIPアドレス(curl -w '\n' ifconfig.me で確認できます)にアクセスして Apache のテストページが表示されるか確認します。

image.png

PHP 7.4 のインストール

apt -y install php7.4 php7.4-mysql

MariaDB 10.5 のインストール

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

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

$ sudo mariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 30
Server version: 10.5.19-MariaDB-0+deb11u2 Debian 11

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 用データベース作成

MariaDB Monitor(mariadbコマンド)上で,文字コードUTF8でデータベース wordpress を作成します。

CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8;

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

46
39
3

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
46
39