WordPressインストール

データベース作成

[root@almalinux ~]# mysql -u root -p ※ MariaDBへrootでログイン
Enter password:  ← MariaDBのrootパスワード
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.29-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)]> create database wordpress; ← wordpressデータベース作成
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> grant all privileges on wordpress.* to wordpress@localhost identified by 'パスワード'; ← wordpressユーザー作成
Query OK, 0 rows affected (0.007 sec)

MariaDB [(none)]> exit ← MariaDBからログアウト
Bye

WordPressインストール

(1)php-mysqlndインストール

[root@almalinux ~]# dnf -y install php-mysqlnd ※ php-mysqlndインストール
完了しました!

(2)WordPressインストール

[root@almalinux ~]# wget http://ja.wordpress.org/latest-ja.zip ← WordPressダウンロード

[root@almalinux ~]# unzip latest-ja.zip ← zipファイル解凍

[root@almalinux ~]# mv wordpress/* /var/www/html ← WordPressのファイルを/var/www/htmlディレクトリ下へ移動

[root@almalinux ~]# chown -R apache. /var/www/html  ← /var/www/htmlディレクトリ所有者をApache実行ユーザーへ変更

[root@almalinux ~]# rm -f latest-ja.zip ← ダウンロードしたファイルを削除

(3)WordPress設定

[root@almalinux ~]# cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php ※ 設定ファイルをサンプルよりコピー

[root@almalinux ~]# vi /var/www/html/wp-config.php ※ 設定ファイル編集
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' ); ← データベース名

/** Database username */
define( 'DB_USER', 'wordpress' ); ← データベースユーザー名

/** Database password */
define( 'DB_PASSWORD', 'パスワード' ); ← データベースユーザーパスワード

define( 'AUTH_KEY',         'put your unique phrase here' ); ← ★
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' ); ← ★
define( 'LOGGED_IN_KEY',    'put your unique phrase here' ); ← ★
define( 'NONCE_KEY',        'put your unique phrase here' ); ← ★
define( 'AUTH_SALT',        'put your unique phrase here' ); ← ★
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' ); ← ★
define( 'LOGGED_IN_SALT',   'put your unique phrase here' ); ← ★
define( 'NONCE_SALT',       'put your unique phrase here' ); ← ★

★:認証用ユニークキーで生成した認証用ユニークキーに置き換える。

(4)WordPress確認
   http://サーバーのIPアドレス/ へアクセスする。
   「サイトのタイトル」、「ユーザー名」、「メールアドレス」を入力して「WordPressをインストール」ボタン押下
   「ユーザー名」、「パスワード」をメモして「ログイン」ボタン押下

   管理画面は、http://サーバーのIPアドレス/wp-login.php

コメント