OracleLinux9.3 WordPressインストール方法

環境
OracleLinux9.3
MySQL8

1.Word Press 用のデータベースを作成
データベース[ark_db] データベースユーザー[ark_user] パスワード[pwd#@12345]とします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# mysql -u root -p
Enter password: ←MySQL 用root パスワード入力します(画面上は表示されません)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.30 Source distribution
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
#WordPressが制御する専用のデータベースを作成
mysql> CREATE DATABASE ark_db DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 1 row affected (0.00 sec)
#データベースの確認
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys
| ark_db |
+--------------------+
5 rows in set (0.00 sec)
#アカウントを作成し、パスワードを設定し、作成したデータベースへのアクセスを許可します
mysql>CREATE USER 'ark_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd#@12345';
Query OK, 0 rows affected (0.04 sec)
ユーザーがセットアップ済データベースにフルアクセスできる必要があることをデータベースに知らせます
mysql> GRANT ALL ON ark_db.* TO 'ark_user'@'localhost';
Query OK, 0 rows affected (0.04 sec)
#権限をリロード
mysql> flush privileges;
#mysqlを終了する
mysql> exit;
Bye
# mysql -u root -p Enter password: ←MySQL 用root パスワード入力します(画面上は表示されません) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 8.0.30 Source distribution Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. #WordPressが制御する専用のデータベースを作成 mysql> CREATE DATABASE ark_db DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; Query OK, 1 row affected (0.00 sec) #データベースの確認 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | ark_db | +--------------------+ 5 rows in set (0.00 sec) #アカウントを作成し、パスワードを設定し、作成したデータベースへのアクセスを許可します mysql>CREATE USER 'ark_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd#@12345'; Query OK, 0 rows affected (0.04 sec) ユーザーがセットアップ済データベースにフルアクセスできる必要があることをデータベースに知らせます mysql> GRANT ALL ON ark_db.* TO 'ark_user'@'localhost'; Query OK, 0 rows affected (0.04 sec) #権限をリロード mysql> flush privileges; #mysqlを終了する mysql> exit; Bye
# mysql -u root -p
 
Enter password: ←MySQL 用root パスワード入力します(画面上は表示されません)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.30 Source distribution
 
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
#WordPressが制御する専用のデータベースを作成
mysql> CREATE DATABASE ark_db DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 1 row affected (0.00 sec)
#データベースの確認
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys
| ark_db |
+--------------------+
5 rows in set (0.00 sec)
 
#アカウントを作成し、パスワードを設定し、作成したデータベースへのアクセスを許可します
mysql>CREATE USER 'ark_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd#@12345';
Query OK, 0 rows affected (0.04 sec)
 
ユーザーがセットアップ済データベースにフルアクセスできる必要があることをデータベースに知らせます
mysql> GRANT ALL ON ark_db.* TO 'ark_user'@'localhost';
Query OK, 0 rows affected (0.04 sec)
 
#権限をリロード
mysql> flush privileges;
 
#mysqlを終了する
mysql> exit;
Bye

2.Wordpressインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cd /var/www/html/arkgame.com
# wget http://ja.wordpress.org/latest-ja.tar.gz
# tar xvf latest-ja.tar.gz
# cd /var/www/html/arkgame.com # wget http://ja.wordpress.org/latest-ja.tar.gz # tar xvf latest-ja.tar.gz
# cd /var/www/html/arkgame.com
# wget http://ja.wordpress.org/latest-ja.tar.gz
# tar xvf latest-ja.tar.gz

3.Wordpress設定ファイルを編集

# cd wordpress/
# cp wp-config-sample.php wp-config.php
# vi wp-config.php

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */^
define('DB_NAME', 'ark_db');
/** Database username */
define('DB_USER', 'ark_user');
/** Database password */
define('DB_PASSWORD', 'pwd#@12345');
// ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */^ define('DB_NAME', 'ark_db'); /** Database username */ define('DB_USER', 'ark_user'); /** Database password */ define('DB_PASSWORD', 'pwd#@12345');
 // ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */^
define('DB_NAME', 'ark_db');
 
/** Database username */
define('DB_USER', 'ark_user');
 
/** Database password */
define('DB_PASSWORD', 'pwd#@12345');

最終行に以下の分を追加します。
これをしないと、プラグインを追加するときにFTP接続情報なるものを聞かれます。
define('FS_METHOD’, 'direct’);

4.ファイルの移動
(1)./var/www/html/arkgame.comの下に展開した中身を移動
# cd /var/www/html/arkgame.com
# mv wordpress/* .

移動されたことを確認後 wordpressディレクトリーとダウンロードしたlatest-ja.tar.gzを削除

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cd /var/www/html/arkgame.com
# rm -R -f wordpress
# rm latest-ja.tar.gz
# cd /var/www/html/arkgame.com # rm -R -f wordpress # rm latest-ja.tar.gz
# cd /var/www/html/arkgame.com
# rm -R -f wordpress
# rm latest-ja.tar.gz

wordpressディレクトリの所有者をapacheにする

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# chown -R apache:apache /var/www/html/arkgame.com
# chown -R apache:apache /var/www/html/arkgame.com
# chown -R apache:apache /var/www/html/arkgame.com

5.ブラウザでhttps://arkgame.com/wp-admin/install.phpにアクセスし、ユーザー名、パスワード等必要事項を入力し、インストールを開始します。

「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」表示されたら 次をインストールしてapacheとmysqlを再起動する

# dnf install php-mysqlnd
# systemctl restart mysqld
# systemctl restart httpd

サイトのタイトル : 任意の名称
ユーザー名 : 任意の名称
パスワード : 任意のパスワード
メールアドレス : 管理者のメールアドレスを入力し、[WordPressをインストール」をクリックする

OracleLinux9.3

Posted by arkgame