業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Debian11.11 : MySQL8 , WordPress インストール

1. MySQL 8インストール

1. 1 パッケージインデックスを更新

必要パッケージをインストール

1.2 MySQLコミュニティリポジトリをインポート

GPGキーをインポート

リポジトリをインポート

APTアップデートを実行

1.3 MySQLインストール

MySQLのルートパスワード入力を2回

新しい認証システムについて表示

[OK]を選択

認証プラグインのデフォルトに合わせ、を選択

aptpolicyインストール

動作確認

Mysqlバージョン確認

1.4. MySQLサーバのセキュリティ設定

MySQLサーバのセキュリティ関連の設定を行うためにmysql_secure_installtionというツールを実行します。
実行すると、質問形式でいくつかのセキュリティ設定がはじまります。はじめに以下のようにパスワードバリデーション用のプラグインを使用するか確認されます。パスワードバリデーションというのは、MySQL用のユーザのパスワード強度をチェックし、十分セキュアなパスワードのみ受け付けるよう制限をかけることができます。例えば、最低何文字以上で必ず記号と数値を1文字以上含むなどです。この条件について次の質問で設定できます。
良ければyを入力してEnterを押します

インストール状況

最後にここまでで設定した内容が表示され、All done!と表示されればセキュリティ設定は完了です

以降 MySQLにアクセスするときは

2.WordPressインストール

2.1 データベース作成

Word Press 用のデータベースを作成します(例として今回はデータベース名を 「wp_db」、ユーザー名を「wp_user」、パスワードを「?Y123456y」)
アカウント作成時「Your password does not satisfy the current policy requirements」が表示される場合はパスワードを8文字以上、英数大文字小文字、記号等を含めてください

2.2 WordPressダウンロードとインストール

①ダウンロードと展開

②Wordpress設定ファイルの編集

wp-config.phpの編集内容

<?php
/**

  • The base configuration for WordPress
    *
  • The wp-config.php creation script uses this file during the installation.
  • and fill in the values.
    *
  • This file contains the following configurations:
    *
  • * Database settings
  • * Secret keys
  • * Database table prefix
  • * ABSPATH
    *
    *
  • @package WordPress
    */

define( 'DB_NAME', 'wp_db' );  ←「2.1 データベース作成」で作成したデータベース名
define( 'DB_USER', 'wp_user' ); ←「2.1 データベース作成」で作成したユーザー名

/** Database password */
define( 'DB_PASSWORD', '?Y123456y' ); ←「2.1 データベース作成」で作成したユーザー用パスワード

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+

  • Authentication unique keys and salts.
    *
  • Change these to different unique phrases! You can generate these using
    *
  • This will force all users to have to log in again.
    *
  • @since 2.6.0
    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' );

/*#@-/

/**

  • WordPress database table prefix.
    *
    *
  • Changing this value after WordPress is installed will make your site think
  • it has not been installed.
    *
    */
    $table_prefix = 'wp_';

/**

  • For developers: WordPress debugging mode.
    *
  • Change this to true to enable the display of notices during development.
  • It is strongly recommended that plugin and theme developers use WP_DEBUG
  • in their development environments.
    *
  • For information on other constants that can be used for debugging,
  • visit the documentation.
    *
  • @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
    */
    define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', DIR . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

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

③ファイルの移動

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

④wordpressディレクトリの所有者をapacheにします

⑤ブラウザからアクセスする
http://[FQDN]/wp-admin
にアクセスします。
成功すると下記のWordpressインストール情報入力画面が出力されます。

Debianで「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」表示されたら

Debianサーバーでphpやmysqlがインストール済みなのにWordpressインストール時に「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」と表示される場合は、下記を確認しましょう。ライブラリ関連がインストールされているか確認、phpのライブラリ関連をインストールしていない場合はインストールします。

MYSQLモジュールのインストール
WordPressはPHPのMYSQLモジュールが必要です。PHPのMYSQLモジュールをインストールしていない場合はインストールします。

インストールが完了したらApacheを再起動をします。

下記入力画面で

  • サイトのタイトル  任意の名称
  • ユーザー名     任意の名称
  • パスワード     任意のパスワード
  • メールアドレス   管理者用メールアドレス

を入力し、「Wordpressインストール」をクリックする。「ユーザー名」「パスワード」はwordpress管理画面にアクセスするときに必要なため忘れないようにする。

タイトルとURLをコピーしました