Linux ~ Apache ~ samba」カテゴリーアーカイブ

CentOS 8 インストール [17]

あっという間に一週間ほど経ってしまいましたねぇ。

その間、何もしなかったかというと、ジタバタいろいろ、

やってました。CentOS 8 への引っ越しが無理なら、

「メンテナンス中」情報流すために使ってるノートサーバーに

引っ越しできないかとやってみたりしました。

でも、結局、真っ白なページが終着駅でした。

しかも、デバッグモードでもエラー吐き出さないほど

真っ白なまま。うーむ。これは、CentOS のバージョンを

合わせてみなければと、CentOS 5から、CentOS 6に

アップしようとすると、

This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU.

PAE 非対応の CPU でした。そこで、あきらめれば、それまで

なんですが、ついつい、

http://www.nozuchi.net/oike/?p=383

を中途半端にマネして案の定爆死して終わりでした。

最後に、Ubuntu に引っ越ししてみようかとまで

思いましたが、これは、さすがに……

で、思いついたのが、手で引っ越しというか、

リアル引っ越しにたとえたら、トラック使っての

引っ越しじゃなくて、猫車使ってみたいな手作業

引っ越しを考えたんですが、たかだか、300記事

くらいなのに、すっごく手間がかかることが

わかりました。記事だけならまだしもコメントまで

移すとなると、けっこう大変なんです。

でも、基本、この方向に行こうかなって思ってます。

新規に、CentOS 8 機にドコライフⅢ を始めて、

ここは、ドコライフ Ⅱ として過去ログ的にリンクだけ

しておこうかなと。で、半年先か一年先かわかりまんが

猫車引っ越しが完了した時点で、そっと、リンク先を

変更して、現サーバをシャットダウンさせるという

手順を考えてます。

CentOS 8 インストール [16]

# vi /var/www/html/neigh/wp-config.php

で、define(‘WP_DEBUG’,false ); の値を true にして、

http://192.168.1.19/neigh/

にアクセスすると、以下のエラーコードが表示されました。

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_Calculator has a deprecated constructor in /var/www/html/neigh/wp-content/plugins/calculator/calculator.php on line 127

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/calculator/calculator.php on line 240

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wHitCounter has a deprecated constructor in /var/www/html/neigh/wp-content/plugins/hit-counter-max/image.php on line 137

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/hit-counter-max/image.php on line 186

Notice: Undefined index: statpress_action in /var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php on line 15

Parse error: syntax error, unexpected ‘new’ (T_NEW) in /var/www/html/neigh/wp-content/plugins/wassup/wassup.php on line 3227

何のことやらわかりません。Google 先生に翻訳してもらいました。

1行目

非推奨:クラスと同じ名前のメソッドは、PHPの将来のバージョンではコンストラクターではなくなります。
WP_Widget_Calculatorには、/ var / www / html / neigh / wp-content / plugins / calculator / calculator.php
の127行目に非推奨のコンストラクターがあります

2行目

“非推奨:関数create_function()は、/ var / www / html / neigh / wp-content / plugins / calculator / calculator.php
の240行目で非推奨になりました”

3行目

“非推奨:クラスと同じ名前のメソッドは、PHPの将来のバージョンではコンストラクターではなくなります。
wHitCounterには、/ var / www / html / neigh / wp-content / plugins / hit-counter-max / image.php
の137行目に非推奨のコンストラクターがあります”

4行目

“非推奨:関数create_function()は、/ var / www / html / neigh / wp-content / plugins / hit-counter-max / image.php
の186行目で非推奨になりました”

5行目

“Notice:未定義のインデックス:15行目の/var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php
のstatpress_action”

6行目

“解析エラー:構文エラー、3227行目の/var/www/html/neigh/wp-content/plugins/wassup/wassup.php
に予期しない「新規」(T_NEW)”

何のことやらわかりません。何のことやらわかりませんが、

たとえば、1行目、2行目は、Calculator プラグインが

邪魔だと言ってるように見えます。

現サーバーの WordPress から Calculator を停止して

削除しましたが、完全には、削除できなかったようです。

同様の理由から、Hi-Counter-Max と StatPress Reloaded 、

WassUpも、削除するつもりでしたが、とりあえず、

停止するだけにしました。

neigh ディレクトリのバックアップを NAS に取ります。

# rm -rf /var/www/html/neigh/

CentOS8機の neigh ディレクトリを削除して、

バックアップし直した neigh ディレクトリを

アップロードします。

# vi /var/www/html/neigh/wp-config.php

WordPress のためのデータベース名、ユーザー名、パスワードなどを

編集して、おそるおそる、http://192.168.1.19/neigh/に

アクセスすると……真っ白でした。

ふたたび、define(‘WP_DEBUG’,true ); にしてエラーコードを

表示させてみると

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wHitCounter has a deprecated constructor in /var/www/html/neigh/wp-content/plugins/hit-counter-max/image.php on line 137

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/hit-counter-max/image.php on line 186

Notice: Undefined index: statpress_action in /var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php on line 15

Parse error: syntax error, unexpected ‘new’ (T_NEW) in /var/www/html/neigh/wp-content/plugins/wassup/wassup.php on line 3227

プラグインを停止させただけでは、ダメみたいね。

Newstatpress は文字化けするので、statpress は、削除したく

ないのだけれど、やむを得ません。

Hi-Counter-Max と StatPress Reloaded 、WassUp を

削除して、バックアップ→アップロードしてみると

またもや、真っ白なページ。エラーコードを表示させると

Notice: Undefined index: statpress_action in /var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php on line 15

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php on line 18

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php on line 19

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php on line 20

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php on line 21

Notice: register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead. in /var/www/html/neigh/wp-includes/functions.php on line 3838

Notice: register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead. in /var/www/html/neigh/wp-includes/functions.php on line 3838

Notice: register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead. in /var/www/html/neigh/wp-includes/functions.php on line 3838

Notice: register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead. in /var/www/html/neigh/wp-includes/functions.php on line 3838

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 269

Deprecated: Function create_function() is deprecated in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php on line 270

Warning: ksort() expects parameter 1 to be array, object given in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 214

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: Undefined index: function in /var/www/html/neigh/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php on line 224

Notice: load_plugin_textdomain がバージョン 2.7.0 から非推奨になった引数付きで呼び出されました。代替は用意されていません。 in /var/www/html/neigh/wp-includes/functions.php on line 4033

Notice: get_currentuserinfo の使用はバージョン 4.5.0 から非推奨になっています ! 代わりに wp_get_current_user() を使ってください。 in /var/www/html/neigh/wp-includes/functions.php on line 3838

Fatal error: Uncaught Error: Call to undefined function eregi() in /var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php:1719 Stack trace: #0 /var/www/html/neigh/wp-includes/class-wp-hook.php(286): iriStatAppend(Object(WP)) #1 /var/www/html/neigh/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #2 /var/www/html/neigh/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /var/www/html/neigh/wp-includes/class-wp.php(504): do_action_ref_array(‘send_headers’, Array) #4 /var/www/html/neigh/wp-includes/class-wp.php(714): WP->send_headers() #5 /var/www/html/neigh/wp-includes/functions.php(960): WP->main(”) #6 /var/www/html/neigh/wp-blog-header.php(16): wp() #7 /var/www/html/neigh/index.php(17): require(‘/var/www/html/h…’) #8 {main} thrown in /var/www/html/neigh/wp-content/plugins/statpress-reloaded/statpress.php on line 1719

ひゃあ。

CentOS 8 インストール [14]

NAS の再構築にかかった時間は、一日と17時間27分20秒でした。

2個の 3TB HDD のフォーマットは、2日ほど経過したところで

電源コードに足をひっかけたせいで、最初っから、やり直しに

なってしまいました。現在、数時間経過して、9%の進捗です。

最低でも、あと二日。おそらく、二日半は、かかるんじゃ

ないでしょうか。

それは、さておき、昨夜までの失敗が、なぜ起きたかが、

ちょっとずつ、見えてきました。

まず、新規にWordPress をインストールして、その上に

現ブログのバックアップを上書きするという作戦自体が

ムダというかダメというか方向違いだったようです。

WordPress の引っ越しにあらたに WordPress を

インストールするという手順は必要ないのです。だって、

ここに、書いてありました。

というわけで、昨夜の作業でできたゴミディレクトリを

rm -rf コマンドでバッサリ削除。

続いて、データベースのゴミを見に行きます。

# mysql -uroot -p**************

ariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| neigh |
| information_schema |
| mysql |
| performance_schema |
+——————–+
5 rows in set (0.056 sec)

MariaDB [(none)]> drop database neigh;
Query OK, 26 rows affected (0.138 sec)

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
+——————–+
3 rows in set (0.000 sec)

ゴミは、掃除できました。続いて、

MariaDB [(none)]> USE mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> SELECT user, host from user;
+———–+———–+
| user | host |
+———–+———–+
| root | 127.0.0.1 |
| root | ::1 |
| neighadmin | localhost |
| root | localhost |
+———–+———–+
4 rows in set (0.000 sec)

MariaDB [mysql]> SHOW GRANTS FOR ‘neighadmin’@’localhost’;
+——————————————————————————————————————+
| Grants for neighadmin@localhost |
+——————————————————————————————————————+
| GRANT USAGE ON *.* TO ‘neighadmin’@’localhost’ IDENTIFIED BY PASSWORD ‘*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19’ |
| GRANT ALL PRIVILEGES ON `neigh`.* TO ‘neighadmin’@’localhost’ |
+——————————————————————————————————————+
2 rows in set (0.000 sec)

MariaDB [mysql]> create database neigh;
Query OK, 1 row affected (0.000 sec)

MariaDB [mysql]> show databases;
+——————–+
| Database |
+——————–+
| neigh |
| information_schema |
| mysql |
| performance_schema |
+——————–+
4 rows in set (0.000 sec)

MariaDB [mysql]> exit
Bye

# vi /var/www/html/neigh/wp-config.php

// ** MySQL 設定 – この情報はホスティング先から入手してください。 ** //
/** WordPress のためのデータベース名 */
define(‘DB_NAME’, ‘neigh’);

/** MySQL データベースのユーザー名 */
define(‘DB_USER’, ‘neighadmin’);

/** MySQL データベースのパスワード */
define(‘DB_PASSWORD’, ‘******************’);

/** MySQL のホスト名 */
define(‘DB_HOST’, ‘localhost’);

/** データベースのテーブルを作成する際のデータベースの文字セット */
define(‘DB_CHARSET’, ‘utf8’);

phpMyAdmin で、上記作成した空のデータベース neigh に

現サーバーの neigh データベースに、インポート。

http://192.168.1.19/neigh/

に、アクセス!うわーん!真っ白なページやん。

じゃあ、

# rm -rf /var/www/html/neigh/

で、Windows にバックアップした /neigh/ を削除して

NAS にバックアップした /neigh/ をアップロードして

wp-config.php を訂正しても……真っ白なページ。

おやすみなさい。(涙)

CentOS 8 インストール [13]

さて、どうしたものでしょう。

RAID: 内蔵ボリューム-再構築進捗 は、現在、70% あたりです。

このまま行くと完了するのは明朝でしょう。再構築中に、NAS に

保存した WordPress データにアクセスしてもいいものなのかどうか

わかりません。データベースのエクスポート先として、NAS を

使うのは、もっと、はばかられます。

昨夜インストールした WordPress は、ちゃんと表示できて

います。

さて、現サーバーから、neigh データベースをエクスポートして、

CentOS 8 機の neigh データベースを削除して新規にneigh データ

ベースを作って、そこにインポートする。(上書きでは、

エラーが起きた)

FTP を使って WordPress データをダウンロードして、それを

CentOS 8 の WordPress ディレクトリに上書きして……

ありゃ、ダメだ。全部のディレクトリの所有者を代えなきゃ

なんない。じゃあ、名前を変えておいて、現サーバーの

WordPress データをそのまんま、アップロードして……

思いつくまま、いろいろ、やりましたが、結局、

データベース接続確立エラー

または、真っ白なページ。

今夜は、ここまで!

CentOS 8 インストール [12]

NAS からのメールでは、

●2019/12/12 23:47
LANDISKのRAID構成異常を検出しました。
内蔵ディスク4が認識されておりません。

とのことでした。つまり、ディスク4が壊れたっぽいと。

マニュアルに従って、ディスク4を取り外し、先ほど買ってきた

新しいディスクに取り替えて取り付けると、自動的に

RAID の再構築にとりかかったようです。

迷いましたが、次の内蔵ディスク異常発生に備えて、もうひとつ、

HDD を買ってきました。これは、とりあえず NTFS で

フォーマットして現サーバーのファイルのバックアップを

置いておこうと思ってます。サーバー移転が済めば、用なしに

なるので、そのまま、NAS の予備HDD として置いておきます。

認識できなくなって取り外した内蔵ディスク4も、一応、

フォーマットして、メイン機などに保管されてるけれど

重要でないというか、いつ捨てても構わないようなファイルの

物置として使おうかなあという計画です。そのぶん、メイン機が

広々とするわけですからね。ケチがついた HDD には、HDD の

使い途があるというわけです。そんなわけで、我が家には、

歴代の HDD が山になっています。間違っても、ブロードリンク社の

不良社員のように転売はしません。流出したら困るような重要な

データがないことは、わかっていてもです。

さて、今夜も、話がそれっぱなしで、なかなか本題が

始まりませんが、WordPress のインストールでした。

# wget https://ja.wordpress.org/wordpress-4.9.1-ja.tar.gz

必要なバージョンのWordPress ダウンロードします。

# tar zxvf wordpress-4.9.1-ja.tar.gz

解凍します。続いて解凍してできたディレクトリを移動 ↓↓↓

# mv wordpress /var/www/

ディレクトリ名変更

# mv /var/www/wordpress /var/www/neigh

不要になった tar.gz を削除

# rm wordpress-4.9.1-ja.tar.gz
rm: 通常ファイル ‘wordpress-4.9.1-ja.tar.gz’ を削除しますか? y

Apacheが読み込めるようにします。

# chown -R dokolife_w.dokolife_w /var/www/neigh

ここまで、作業したところで、現サーバーでは、/var/www/neigh で

ちゃんとアクセスできるのに、CentOS8機ではどうやっても

ウマクいきません。そこで、いろいろ調べてみたものの、

どうにも、わからないのです。

私が、当時、WordPress をインストールしたときに参考にしたのは

このページです。

[root@centos ~]# mv wordpress /var/www/ ← WordPress解凍先ディレクトリを/var/wwwディレクトリ下へ移動

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

となってて、そのまんま、インストールしました。これが、今になって苦労する元と

なっているようです。なぜ、当時はできて今はできないのか調べても調べても

わかりません。で、あきらめました。おそらく、当時の Apache ならできたけど

今時の Apache では、そんなことできない。ってところかしら。cgi-bin も、

/var/www/ 直下に置いてたもんね。

# mv /var/www/neigh /var/www/html/neigh

ドキュメントルートの下に移動しました。

次のステップは、MariaDBへの接続です。

# mysql -uroot -p****** <=パスワードを指定

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.11-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用データベースを作成します。

MariaDB [(none)]> CREATE DATABASE neigh;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> SHOW DATABASES;
+——————–+
| Database |
+——————–+
| neigh |
| information_schema |
| mysql |
| performance_schema |
+——————–+
4 rows in set (0.035 sec)

neigh が作成されました。

WordPress用データベースユーザーの作成と権限の設定をします。

MariaDB [(none)]> GRANT ALL ON neigh.* TO ‘neighadmin’@’localhost’ IDENTIFIED BY ‘****************’;
Query OK, 0 rows affected (0.000 sec)

確認。

MariaDB [(none)]> USE mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> SELECT user, host from user;
+———–+———–+
| user | host |
+———–+———–+
| root | 127.0.0.1 |
| root | ::1 |
| neighadmin | localhost |
| root | localhost |
+———–+———–+
4 rows in set (0.000 sec)

MariaDB [mysql]> SHOW GRANTS FOR ‘neighadmin’@’localhost’;
+——————————————————————————————————————+
| Grants for neighadmin@localhost |
+——————————————————————————————————————+
| GRANT USAGE ON *.* TO ‘neighadmin’@’localhost’ IDENTIFIED BY PASSWORD ‘*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19’ |
| GRANT ALL PRIVILEGES ON `neigh`.* TO ‘neighadmin’@’localhost’ |
+——————————————————————————————————————+
2 rows in set (0.000 sec)

確認できたので、MariaDBとの接続を切断します。

MariaDB [mysql]> quit
Bye

WordPress をインストールします。

今夜は、ここまでです。RAID: 内蔵ボリューム-再構築は、8時間半を経過しても、

終了のきざしはありませんし、ふたつのHDDのフォーマットは、現在、12% です。

CentOS 8 インストール [11]

昨夜は、二つの未解決事項をかかえていました。ひとつは、せっかくの NAS の

共有フォルダを表示できない=ネットワークドライブの割り当てができない

というもので、もうひとつは、今月の Windows Update のうちの一部が

更新して再起動しても、いつまでもクルクルと起動できないというものでした。

Windows Update の失敗については、解決しないものの、さしあたっての

対処法が見つかったので、問題先送りにすることにして、NAS が

利用できないというもうひとつの問題について検索していました。

答えは、ここにありました。この情報の通りにアクセス権を持った

ユーザーを追加して、ネットワークドライブに割り当てるフォルダは

¥¥192.168.1.***¥[NAS の共有フォルダ名]として

めでたく、解決しました。2年前に、NAS を利用したときには、

Windows 7 機だったので、こんなことになってるとは気づくことが

できなかったようです。

さて、CentOS8機の構築を続けます。今回は永久凍土下に埋もれている

ブログを CentOS8機に移設してみるという取り組みでした。

このブログを CentOS8機の /var/www/neigh にコピーできれば、

続いて、ドコライフも移設できる道が開けるということになります。

現サーバーは、CentOS release 6.10 (Final)  で、WordPress 4.9.1 です。

かなり、古いんです。ドコライフの WordPress は、そこまでではないと

いうものの、5.1.1 で、こちらも古いです。かろうじて、XSSの脆弱性への

対策は施されているというものの、原則としては、最新のものを使うべきです。

まあ、そのあたりも、早く移設しなければと考えた動機なんですけどね。

ところで、古いバージョンを使ってることを書いちゃって大丈夫?という

心配は当然のことなんですけど、最新のものは、どうなってるか知りませんが

少なくとも、当時の WordPress は、使用しているバージョンが見えちゃう

仕様なのね。これは、今回、自分の WordPress のバージョンを調べてみるまで

知りませんでした。

話が、それてそれて、いつまで経っても本題に入れませんが、まず始めに

FTP を使って、凍結ブログの WordPress フォルダ = neigh フォルダを

ごっそりと、NAS にコピーしました。NAS は、ext2 か ext3 かは、

わからないけど、いずれにしても、Lunx のファイルシステムになってる

みたいです。パーミッション問題とかの発生リスクを考えると

これは、好都合。

次に、現サーバーのデータベース neigh をNAS にエクスポート。

neigh/sql という名前で保存しました。

さて、いよいよ、WordPress のインストールというステップに

取りかかるところという宴もたけなわ状態ですが、明朝、予定が

入っているので、今夜は、このへんで、おやすみなさい……

おや? NAS が、ピーッ、ピーッ、ピーッ、ピーッ、という

警告音とともに、赤い LED が点滅し出したではありませんか!

CentOS 8 インストール [10]

クローンを使って、「CentOS 8 インストール [08] 」の状態に戻しました。

ところで、私のクローン作成方法ですが、SANWA SUPPLY の

HDDコピー機能付きSATA – USB3.0変換ケーブル製品品番 USB-CVIDE4

を使ってます。

↑↑↑ んな感じに、HDD ケースをハズしてクローン作ることもあるし、

パソコンに取り付けたままで、クローンを作ることもあります。

究極のバックアップだし、異常が起きた時、ただちに動作させることが

できるという強みもあります。しかし、今回は 2TB の HDD を

使ったので、作業に3時間以上かかったのは、誤算でした。

これまでは、ブートディスクは、500 GB か、せいぜい、1 TB しか

使ったことがなかったので、この方式ばかりに頼るのは考え物ですね。

それに、ほとんど手間いらずとはいえ、定期的なバックアップの

方式としても、欠点があるので、今回の引っ越しがウマクいけば、

WordPress のバックアップをそれこそ毎日でもとることが容易になる

道が見つかるでしょう。手持ちの NAS を宝の持ち腐れにせずに済むし。

(すでに、2年近く経過してるのに、有効活用ができてませんでした。

ごめんなさい。今度こそ、ちゃんと使います。)

WordPress の引っ越し 第一回目試行で、WordPress ディレクトリの

大きさも、データベースのサイズもたいしたことがないということが

わかりました。PHPMyAdmin で十分扱える大きさだし、現サーバーには

すでに インストール済みだし、新サーバーにインストールする方法も

ほぼ、理解できたようなので、あとは、バックアップの戻し方さえ

マスターできれば、問題解決!……のハズ。

さて、現サーバーには、このドコライフとは別に、もうひとつ WordPress を

インストールしてあります。そのブログは、あまりにも来訪者が少なく、

ちょうど 一年前に更新をストップすると告知したまま、凍結中です。

引っ越しの第二回目試行では、この氷結ブログの移設を中心に進めて

いこうと思います。まあ、いい練習台だし、このブログみたいに

バックアップをとったあとに記事を追加しないわけだから、移設できたら

そのまま使えるということです。

さて、「CentOS 8 インストール [09]」に戻って、CentOS8機に、

PHPMyAdmin をインストールします。最初に、ダウンロード

# wget https://files.phpmyadmin.net/phpMyAdmin/4.9.2/phpMyAdmin-4.9.2-all-languages.tar.gz

–2019-12-11 22:57:27– https://files.phpmyadmin.net/phpMyAdmin/4.9.2/phpMyAdmin-4.9.2-all-languages.tar.gz
files.phpmyadmin.net (files.phpmyadmin.net) をDNSに問いあわせています… 89.187.160.6
files.phpmyadmin.net (files.phpmyadmin.net)|89.187.160.6|:443 に接続しています… 接続しました。
HTTP による接続要求を送信しました、応答を待っています… 200 OK
長さ: 10135813 (9.7M) [application/octet-stream]
`phpMyAdmin-4.9.2-all-languages.tar.gz’ に保存中

phpMyAdmin-4.9.2-al 100%[===================>] 9.67M 674KB/s 時間 15s

2019-12-11 22:57:42 (681 KB/s) – `phpMyAdmin-4.9.2-all-languages.tar.gz’ へ保存 完了 [10135813/10135813]

ダウンロードしたファイルを解凍

# tar -zxvf phpMyAdmin-4.9.2-all-languages.tar.gz
phpMyAdmin-4.9.2-all-languages/
phpMyAdmin-4.9.2-all-languages/CODE_OF_CONDUCT.md
phpMyAdmin-4.9.2-all-languages/CONTRIBUTING.md
phpMyAdmin-4.9.2-all-languages/ChangeLog
phpMyAdmin-4.9.2-all-languages/DCO
phpMyAdmin-4.9.2-all-languages/LICENSE
phpMyAdmin-4.9.2-all-languages/README
phpMyAdmin-4.9.2-all-languages/RELEASE-DATE-4.9.2

中略

phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/TwigFilter.php
phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/TwigFunction.php
phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/TwigTest.php
phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/Util/
phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/Util/DeprecationCollector.php
phpMyAdmin-4.9.2-all-languages/vendor/twig/twig/src/Util/TemplateDirIterator.php
phpMyAdmin-4.9.2-all-languages/version_check.php
phpMyAdmin-4.9.2-all-languages/view_create.php
phpMyAdmin-4.9.2-all-languages/view_operations.php
phpMyAdmin-4.9.2-all-languages/yarn.lock

4.9.1 に比べるとファイル数が 500 くらい減ってますね。

解凍してできたディレクトリを移動

# mv phpMyAdmin-4.9.2-all-languages /usr/dokolife_w/

ディレクトリ名変更

# mv /usr/dokolife_w/phpMyAdmin-4.9.2-all-languages /usr/dokolife_w/phpMyAdmin

不要になった tar.gz を削除

# rm phpMyAdmin-4.9.2-all-languages.tar.gz
rm: 通常ファイル ‘phpMyAdmin-4.9.2-all-languages.tar.gz’ を削除しますか? y

phpMyAdminを構成する

サンプル構成ファイルをコピーします。

# cp -pr /usr/dokolife_w/phpMyAdmin/config.sample.inc.php /usr/dokolife_w/phpMyAdmin/config.inc.php

config.inc.php を編集して、blowfish_secret を追加します。

# vi /usr/dokolife_w/pMAmin/config.inc.php

$cfg[‘blowfish_secret’] = ‘jinSEirakuaRYa‘; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

phpMyAdminのtmpディレクトリを作成し、権限を変更します。

# mkdir /usr/dokolife_w/phpMyAdmin/tmp
# chmod 777 /usr/dokolife_w/phpMyAdmin/tmp

phpMyAdminの所有権を設定します。

# chown -R dokolife_w:dokolife_w /usr/dokolife_w/phpMyAdmin


php-json パッケージをインストールします。

# dnf install -y php-json.x86_64
メタデータの期限切れの最終確認: 0:56:29 時間前の 2019年12月11日 22時59分42秒 に 実施しました。
依存関係が解決しました。
================================================================================
パッケージ アーキテクチャー
バージョン リポジトリ サイズ
================================================================================
Installing:
php-json x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 73 k

トランザクションの概要
================================================================================
インストール 1 パッケージ

ダウンロードサイズの合計: 73 k
インストール済みのサイズ: 45 k
パッケージのダウンロード中です:
php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x8 55 kB/s | 73 kB 00:01
——————————————————————————–
合計 23 kB/s | 73 kB 00:03
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
準備 : 1/1
Installing : php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 1/1
scriptletの実行中: php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 1/1
検証 : php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 1/1

インストール済み:
php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64

完了しました!

パーミッションを変更します。

# chmod 777 /var/lib/php/session

さて、http://192.168.1.19/phpMyAdmin/ に接続してみると、

無事、ログイン画面が表示されました。

今夜は、ここまで。

CentOS 8 インストール [09]

いよいよ、WordPress の引っ越しにかかるわけですが、だいたいの道筋を

あらかじめ調べて、一気に実行!と思ったのですが、最初の分かれ道までを

調べて、次に、その次の分かれ道までを調べた時点で、最初に調べた部分が

薄ぼんやりとしてくることがわかりました。さらに、その次の道筋なんぞを

調べようものなら、最初の部分は、完全に脳内から消滅してしまいます。

「間違えたときのためのクローン作成じゃないか」

と自分を励まして?やはり、一段ずつ階段を登ることにしました。

最初に、WordPress が格納されたディレクトリを FTP で丸ごとダウンロードして

CentOS 8 機の同じ場所にアップロードしました。このプロセスは、

まず、引っ越し先に WordPress をインストールしておいて、そこに、

上書きの形でアップロードするほうがいいという書き方をしてるサイトの

ほうが、多かったのですが、「いやいや、インストールなんてしなくて

いいのだ。単にディレクトリごとアップロードすればいい」

というサイトも、あったので、とりあえず、まんまでアップロードしました。

次に、データベースの移行ですが、MySQL のバージョンが

# mysql –version
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (i386) using readline 5.1

だったので、phpMyAdmin-4.0.10.9-all-languages.zip をダウンロードして

インストールしました。そして、WordPress の Database をエクスポート

しました。サイズは、9.14 MB と思ったより小さかったので、CentOS 8 機にも

phpMyAdmin-4.9.2-all-languages をインストールしようとしたのですが、

参考ページからのコピペを書き換えるのを忘れて、実際にインストールしたのは

phpMyAdmin-4.9.1-all-languagesでした。

さっそく、phpMyAdmin にアクセスしてみると……これが、ウンともスンとも、

ページは真っ白なまま。

やはり、CentOS 6 に phpMyAdmin-4.0.10.9-all-languages をインストールするのとは、

違うようで、じゃあ、CentOS8機に直接インストールしてみようと思ったわけです。

# wget https://files.phpmyadmin.net/phpMyAdmin/4.9.1/phpMyAdmin-4.9.1-all-languages.tar.gz

公式ページからパッケージをダウンロードしました。

# tar -zxvf phpMyAdmin-4.9.1-all-languages.tar.gz

↑↑↑ phpMyAdminをインストール

# mv phpMyAdmin-4.9.1-all-languages /usr/dokolife_w/phpMyAdmin

↑↑↑ phpMyAdminセットアップを目的の場所に移動……なんですが、

/usr/dokolife_w/phpMyAdmin/phpMyAdmin-4.9.1-all-languages

ディレクトリ内にセットアップした形になってしまい、FTP を使って

本来の目的の場所に再移動するハメになりました。

# mv phpMyAdmin-4.9.1-all-languages /usr/dokolife_w

で移動して、ディレクトリの名前を好きなように変更したほうがラクでした。

phpMyAdminを構成する

サンプル構成ファイルをコピーします。

# cp -pr /usr/dokolife_w/phpMyAdmin/config.sample.inc.php /usr/dokolife_w/phpMyAdmin/config.inc.php

構成ファイルを編集して、blowfish_secret を追加します。

$cfg[‘blowfish_secret’] = ‘jinSEirakuaRYa‘; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

phpMyAdminのtmpディレクトリを作成し、権限を変更します。

# mkdir /usr/dokolife_w/phpMyAdmin/tmp
# chmod 777 /usr/dokolife_w/phpMyAdmin/tmp

phpMyAdminの所有権を設定します。

# chown -R dokolife_w:dokolife_w /usr/dokolife_w/phpMyAdmin

さて、http://192.168.1.19/phpMyAdmin/ に接続してみると、

phpMyAdmin – Error
The json extension is
missing. Please check your PHP configuration.

エラーが出てしまいました。
いろいろ、検索しまくって、↓↓↓ のパッケージをインストール。
# dnf install -y php-json.x86_64

phpMyAdmin – Error
Error during session
start; please check your PHP and/or webserver log file and
configure your PHP installation properly. Also ensure that
cookies are enabled in your browser.
session_start():
open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
session_start(): Failed
to read session data: files (path: /var/lib/php/session)

今度は、↑↑↑ のエラー。またまた、検索しまくって、

# chmod 777 /var/lib/php/session

やっと、ログイン画面が表示されました。WordPress の Database をインポートして、

http://192.168.1.19/wordpress/

に、接続してみると、

データベース接続確立エラー

がーん。

CentOS 8 インストール [08]

さあ、今夜も頭蓋骨内に蟹味噌を製造するゾーっ!

5-1. php-fpmの起動と起動後の確認

# systemctl start php-fpm
# systemctl status php-fpm
php-fpm.service – The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor pr>
Active: active (running) since Mon 2019-12-09 17:22:15 JST; 2min 12s ago
Main PID: 839 (php-fpm)
Status: “Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/s>
Tasks: 3 (limit: 26213)
Memory: 25.1M
CGroup: /system.slice/php-fpm.service
tq 839 php-fpm: master process (/etc/php-fpm.conf)
tq1137 php-fpm: pool www
mq1138 php-fpm: pool www

12月 09 17:22:13 localhost.localdomain systemd[1]: Starting The PHP FastCGI Pro>
12月 09 17:22:15 localhost.localdomain php-fpm[839]: [09-Dec-2019 17:22:15] WAR>
12月 09 17:22:15 localhost.localdomain php-fpm[839]: [09-Dec-2019 17:22:15] WAR>
12月 09 17:22:15 localhost.localdomain systemd[1]: Started The PHP FastCGI Proc>
lines 1-16/16 (END)


5-2. php-fpmの自動起動設定

# systemctl enable php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.

# systemctl is-enabled php-fpm
enabled

6-1. php.iniの変更

# cp -p /etc/php.ini /etc/php.ini.org
# vi /etc/php.ini

6-1-1. PHPのセキュリティ設定

expose_php = Off      (PHPのバージョンを非表示)

6-1-2. アップロードサイズの変更

post_max_size = 20M

upload_max_filesize = 20M

6-1-3. タイムゾーンの設定

date.timezone = “Asia/Tokyo” (コメントアウトを外して追記)

6-1-4. マルチバイト対応(日本語対応)設定

mbstring.language = Japanese (コメントアウトを外した)

mbstring.internal_encoding = UTF-8 (コメントアウトを外して追記)

mbstring.http_input = UTF-8 (コメントアウトを外して追記)

mbstring.http_output = pass (コメントアウトを外して追記)

mbstring.encoding_translation = On (コメントアウトを外して変更)

mbstring.detect_order = auto (コメントアウトを外した)

mbstring.substitute_character = none (コメントアウトを外した)

7. php.ini設定ファイルの反映とhttpdの確認

# systemctl restart php-fpm
# systemctl status php-fpm
php-fpm.service – The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor pre>
Active: active (running) since Mon 2019-12-09 18:05:56 JST; 13s ago
Main PID: 2014 (php-fpm)
Status: “Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/s>
Tasks: 3 (limit: 26213)
Memory: 12.5M
CGroup: /system.slice/php-fpm.service
tq2014 php-fpm: master process (/etc/php-fpm.conf)
tq2017 php-fpm: pool www
mq2018 php-fpm: pool www

12月 09 18:05:56 localhost.localdomain systemd[1]: Starting The PHP FastCGI Pro>
12月 09 18:05:56 localhost.localdomain php-fpm[2014]: [09-Dec-2019 18:05:56] WA>
12月 09 18:05:56 localhost.localdomain php-fpm[2014]: [09-Dec-2019 18:05:56] WA>
12月 09 18:05:56 localhost.localdomain systemd[1]: Started The PHP FastCGI Proc>
lines 1-16/16 (END)

 

# systemctl restart httpd
[root@localhost ~]# systemctl status httpd
httpd.service – The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor prese>
Drop-In: /usr/lib/systemd/system/httpd.service.d
mqphp-fpm.conf
Active: active (running) since Mon 2019-12-09 18:10:21 JST; 11s ago
Docs: man:httpd.service(8)
Main PID: 2029 (httpd)
Status: “Running, listening on: port 80”
Tasks: 213 (limit: 26213)
Memory: 51.3M
CGroup: /system.slice/httpd.service
tq2029 /usr/sbin/httpd -DFOREGROUND
tq2031 /usr/sbin/httpd -DFOREGROUND
tq2032 /usr/sbin/httpd -DFOREGROUND
tq2033 /usr/sbin/httpd -DFOREGROUND
mq2034 /usr/sbin/httpd -DFOREGROUND

12月 09 18:10:21 localhost.localdomain systemd[1]: Starting The Apache HTTP Ser>
12月 09 18:10:21 localhost.localdomain httpd[2029]: Server configured, listenin>
12月 09 18:10:21 localhost.localdomain systemd[1]: Started The Apache HTTP Serv>
lines 1-20/20 (END)

8. 動作確認

見事に動作しているのでしょう。

今夜は、盛りだくさん!続いて

CentOS 8にMySQL互換のデータベース MariaDB 10をインストールする

今回も、参考というよりも丸写しすると思われるページは、ここ


3-2. MariaDBのインストール

# dnf install -y mariadb-server mariadb mariadb-devel

自動的にインストールされて、「完了しました!」と表示されたら、

# dnf list installed | grep mariadb
mariadb.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-backup.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-common.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-connector-c.x86_64 3.0.7-1.el8 @AppStream
mariadb-connector-c-config.noarch 3.0.7-1.el8 @AppStream
mariadb-connector-c-devel.x86_64 3.0.7-1.el8 @AppStream
mariadb-devel.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-errmsg.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-gssapi-server.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-server.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream
mariadb-server-utils.x86_64 3:10.3.11-2.module_el8.0.0+35+6f2527ed @AppStream

3-4. MariaDB起動の確認

# systemctl start mariadb
# systemctl status mariadb
mariadb.service – MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor pr>
mariadb.service – MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor pr>
mariadb.service – MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor pr>
mariadb.service – MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor pr>
Active: active (running) since Mon 2019-12-09 18:40:22 JST; 14s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 6605 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, st>
Process: 6471 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service >
Process: 6446 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, stat>
Main PID: 6574 (mysqld)
Status: “Taking your SQL requests now…”
Tasks: 30 (limit: 26213)
Memory: 86.3M
CGroup: /system.slice/mariadb.service
mq6574 /usr/libexec/mysqld –basedir=/usr

12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: Please report any problems at http://mariadb.org/jira
12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: The latest information about MariaDB is available at http://mariadb.org/.
12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: You can find additional information about the MySQL part at:
12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: http://dev.mysql.com
12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: Consider joining MariaDB’s strong and vibrant community:
12月 09 18:40:22 localhost.localdomain mysql-prepare-db-dir[6471]: https://mariadb.org/get-involved/
12月 09 18:40:22 localhost.localdomain mysqld[6574]: 2019-12-09 18:40:22 0 [Note] /usr/libexec/mysqld (mysqld 10.3.11-MariaDB) starting as process 6574 …
12月 09 18:40:22 localhost.localdomain mysqld[6574]: 2019-12-09 18:40:22 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4186)
12月 09 18:40:22 localhost.localdomain mysqld[6574]: 2019-12-09 18:40:22 0 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 (was 151) table_cache: 421 (was 2000)
12月 09 18:40:22 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
lines 1-25/25 (END)

 

3-5. MariaDB自動起動の設定

# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

# systemctl is-enabled mariadb
enabled

4-1. mysql_secure_installationの実行

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

5-1. server.cnfの変更

# cp -p /etc/my.cnf.d/mariadb-server.cnf /etc/my.cnf.d/mariadb-server.cnf.org
# vi /etc/my.cnf.d/mariadb-server.cnf

# this is read by the standalone daemon and embedded servers
[server]
character-set-server=utf8 (行を挿入して追記)

6. mariadb-server.cnf設定ファイルの反映とMariaDBの動作確認

# systemctl restart mariadb
# systemctl status mariadb
mariadb.service – MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-12-09 19:14:51 JST; 11s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 6821 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 6752 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/>
Process: 6725 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 6790 (mysqld)
Status: “Taking your SQL requests now…”
Tasks: 30 (limit: 26213)
Memory: 74.7M
CGroup: /system.slice/mariadb.service
mq6790 /usr/libexec/mysqld –basedir=/usr

12月 09 19:14:50 localhost.localdomain systemd[1]: Starting MariaDB 10.3 database server…
12月 09 19:14:50 localhost.localdomain mysql-prepare-db-dir[6752]: Database MariaDB is probably initia>
12月 09 19:14:50 localhost.localdomain mysql-prepare-db-dir[6752]: If this is not the case, make sure >
12月 09 19:14:51 localhost.localdomain mysqld[6790]: 2019-12-09 19:14:51 0 [Note] /usr/libexec/mysqld >
12月 09 19:14:51 localhost.localdomain mysqld[6790]: 2019-12-09 19:14:51 0 [Warning] Could not increas>
12月 09 19:14:51 localhost.localdomain mysqld[6790]: 2019-12-09 19:14:51 0 [Warning] Changed limits: m>
12月 09 19:14:51 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
lines 1-22/22 (END)

7. 動作確認

# mysql -uroot -p************************
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.11-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 test_db;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
| test_db |
+——————–+
4 rows in set (0.000 sec)

MariaDB [(none)]> use test_db;
Database changed
MariaDB [test_db]> show variables like “chara%”;
+————————–+——————————+
| Variable_name | Value |
+————————–+——————————+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mariadb/charsets/ |
+————————–+——————————+
8 rows in set (0.001 sec)

MariaDB [test_db]> drop database test_db;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
+——————–+
3 rows in set (0.000 sec)

MariaDB [(none)]> quit
Bye

動作確認は完了しました。以上で、基本的なLAMP環境が完成したので、

クローンを作成しておきます。

 

CentOS 8 インストール [07]

今夜も、このページを参考にしながら、PHP をインストールします。

CentOS と Apache httpd のバージョンを確認します。

# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
# httpd -V | head -n 1
Server version: Apache/2.4.37 (centos)

3-1. PHPパッケージの情報確認

# dnf info php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-mysqlnd
メタデータの期限切れの最終確認: 0:06:55 時間前の 2019年12月08日 20時45分19秒 に 実施しました。
利用可能なパッケージ
名前 : php
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 1.5 M
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
ライセンス : PHP and Zend and BSD and MIT and ASL 1.0
説明 : PHP is an HTML-embedded scripting language. PHP attempts to make
: it easy for developers to write dynamically generated web pages.
: PHP also offers built-in database integration for several
: commercial and non-commercial database management systems, so
: writing a database-enabled webpage with PHP is fairly simple. The
: most common use of PHP coding is probably as a replacement for
: CGI scripts.
:
: The php package contains the module (often referred to as
: mod_php) which adds support for the PHP language to Apache HTTP
: Server.

名前 : php-gd
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 83 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A module for PHP applications for using the gd graphics library
URL : http://www.php.net/
ライセンス : PHP
説明 : The php-gd package contains a dynamic shared object that will add
: support for using the gd graphics library to PHP.

名前 : php-mbstring
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 580 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A module for PHP applications which need multi-byte string
: handling
URL : http://www.php.net/
ライセンス : PHP and LGPLv2 and OpenLDAP
説明 : The php-mbstring package contains a dynamic shared object that
: will add support for multi-byte string handling to PHP.

名前 : php-mysqlnd
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 190 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A module for PHP applications that use MySQL databases
URL : http://www.php.net/
ライセンス : PHP
説明 : The php-mysqlnd package contains a dynamic shared object that
: will add MySQL database support to PHP. MySQL is an
: object-relational database management system. PHP is an
: HTML-embeddable scripting language. If you need MySQL support for
: PHP applications, you will need to install this package and the
: php package.
:
: This package use the MySQL Native Driver

名前 : php-pdo
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 122 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A database access abstraction module for PHP applications
URL : http://www.php.net/
ライセンス : PHP
説明 : The php-pdo package contains a dynamic shared object that will
: add a database access abstraction layer to PHP. This module
: provides a common interface for accessing MySQL, PostgreSQL or
: other databases.

名前 : php-xml
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 188 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A module for PHP applications which use XML
URL : http://www.php.net/
ライセンス : PHP
説明 : The php-xml package contains dynamic shared objects which add
: support to PHP for manipulating XML documents using the DOM tree,
: and performing XSL transformations on XML documents.

名前 : php-xmlrpc
バージョン : 7.2.11
リリース : 1.module_el8.0.0+56+d1ca79aa
アーキテクチ : x86_64
サイズ : 89 k
ソース : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm
Repo : AppStream
概要 : A module for PHP applications which use the XML-RPC protocol
URL : http://www.php.net/
ライセンス : PHP and BSD
説明 : The php-xmlrpc package contains a dynamic shared object that will
: add support for the XML-RPC protocol to PHP.

3-2. PHPのインストール

# dnf install -y php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-mysqlnd
メタデータの期限切れの最終確認: 0:12:55 時間前の 2019年12月08日 20時45分19秒 に 実施しました。
依存関係が解決しました。
================================================================================
パッケージ アーキテクチャー
バージョン リポジトリ
サイズ
================================================================================
Installing:
php x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 1.5 M
php-gd x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 83 k
php-mbstring x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 580 k
php-mysqlnd x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 190 k
php-pdo x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 122 k
php-xml x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 188 k
php-xmlrpc x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 89 k
依存関係をインストール中:
nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+184+e34fea82 AppStream 24 k
php-cli x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 3.1 M
php-common x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 653 k
弱い依存関係をインストール中:
php-fpm x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 1.6 M
Enabling module streams:
nginx 1.14
php 7.2

トランザクションの概要
================================================================================
インストール 11 パッケージ

ダウンロードサイズの合計: 8.1 M
インストール済みのサイズ: 29 M
パッケージのダウンロード中です:
(1/11): nginx-filesystem-1.14.1-9.module_el8.0. 21 kB/s | 24 kB 00:01
(2/11): php-common-7.2.11-1.module_el8.0.0+56+d 291 kB/s | 653 kB 00:02
(3/11): php-7.2.11-1.module_el8.0.0+56+d1ca79aa 186 kB/s | 1.5 MB 00:08
(4/11): php-gd-7.2.11-1.module_el8.0.0+56+d1ca7 75 kB/s | 83 kB 00:01
(5/11): php-mbstring-7.2.11-1.module_el8.0.0+56 155 kB/s | 580 kB 00:03
(6/11): php-fpm-7.2.11-1.module_el8.0.0+56+d1ca 159 kB/s | 1.6 MB 00:10
(7/11): php-pdo-7.2.11-1.module_el8.0.0+56+d1ca 147 kB/s | 122 kB 00:00
(8/11): php-mysqlnd-7.2.11-1.module_el8.0.0+56+ 138 kB/s | 190 kB 00:01
(9/11): php-xmlrpc-7.2.11-1.module_el8.0.0+56+d 172 kB/s | 89 kB 00:00
(10/11): php-xml-7.2.11-1.module_el8.0.0+56+d1c 208 kB/s | 188 kB 00:00
(11/11): php-cli-7.2.11-1.module_el8.0.0+56+d1c 198 kB/s | 3.1 MB 00:16
——————————————————————————–
合計 472 kB/s | 8.1 MB 00:17
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
準備 : 1/1
Installing : php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 1/11
Installing : php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 2/11
Installing : php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 3/11
Installing : php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 4/11
scriptletの実行中: nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 5/11
Installing : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 5/11
Installing : php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 6/11
scriptletの実行中: php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 6/11
Installing : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 7/11
Installing : php-xmlrpc-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 8/11
Installing : php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x8 9/11
Installing : php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 10/11
Installing : php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x 11/11
scriptletの実行中: php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x 11/11
scriptletの実行中: php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 11/11
検証 : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 1/11
検証 : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 2/11
検証 : php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 3/11
検証 : php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 4/11
検証 : php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 5/11
検証 : php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 6/11
検証 : php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x 7/11
検証 : php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x8 8/11
検証 : php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 9/11
検証 : php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 10/11
検証 : php-xmlrpc-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 11/11

インストール済み:
php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-xmlrpc-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch
php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64

完了しました!

3-3. インストールされたPHPパッケージの確認

# dnf list installed | grep php
php.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-cli.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-common.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-fpm.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-gd.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-mbstring.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-mysqlnd.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-pdo.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-xml.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream
php-xmlrpc.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream

3-4. php72 cliの動作確認

# php -v
PHP 7.2.11 (cli) (built: Oct 9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

4-1. インストールされたphp-fpmパッケージの確認

# dnf list installed | grep php-fpm
php-fpm.x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa @AppStream

4-2-1. php-fpm設定ファイルのバックアップ

# cp -p /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.org
# vi /etc/php-fpm.d/www.conf

4-3-1. php-fpmを動作させるユーザー、グループの設定変更

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user’s group
; will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
user = dokolife_w
; RPM: Keep a group allowed to write in log dir.
group = dokolife_w

4-3-2. ソケット接続用の設定

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = dokolife_w
listen.group = dokolife_w
listen.mode = 0666
(3行ともコメントアウトを外す)

4-3-3. pm.max_パラメーターの変更

このあたりから、どのような設定にするか、悩ましいところです。

かなりの数のページを読みましたが、ハッキリ言ってよくわかりません。

私の CentOS8機の CPU は 2コアで、メモリは、8GB です。

CPU がボトルネックになるので、

pm.max_children = 2

としようと考えました。(コア数の2倍程度に設定するのがいいよという記事もありました)

pm = dynamic とした場合、各数値には以下のようなルールがあるとのことなので、

・pm.start_serversはpm.max_children,pm.max_spare_serversを超えてはならない
・pm.min_spare_serversはpm.max_children,pm.start_servers,pm.max_spare_serversを超えてはならない
・pm.max_spare_serversはpm.max_childrenを超えてはならない

すべて、2以下の数値でなければならないことになります。

意味ないじゃん?

だから、pm = static 決定!

しかし、その場合、設定不要となる pm.start_servers 、

pm.min_spare_servers 、pm.max_spare_servers を

コメントアウトしておけと書いてるページが見つからなかったんだよね。

こういうとき、基本的な知識に欠けてると大いに悩むことに

なるんですが、今回は、コメントアウトしてみました。

; Choose how the process manager will control the number of child processes.
; Possible Values:
; static – a fixed number (pm.max_children) of child processes;
; dynamic – the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children – the maximum number of children that can
; be alive at the same time.
; pm.start_servers – the number of children created on startup.
; pm.min_spare_servers – the minimum number of children in ‘idle’
; state (waiting to process). If the number
; of ‘idle’ processes is less than this
; number then some children will be created.
; pm.max_spare_servers – the maximum number of children in ‘idle’
; state (waiting to process). If the number
; of ‘idle’ processes is greater than this
; number then some children will be killed.
; ondemand – no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children – the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout – The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = static

; The number of child processes to be created when pm is set to ‘static’ and the
; maximum number of child processes when pm is set to ‘dynamic’ or ‘ondemand’.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don’t
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to ‘static’, ‘dynamic’ or ‘ondemand’
; Note: This value is mandatory.
pm.max_children = 2

; The number of child processes created on startup.
; Note: Used only when pm is set to ‘dynamic’
; Default Value: min_spare_servers + (max_spare_servers – min_spare_servers) / 2
; pm.start_servers = 5 (コメントアウト)

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to ‘dynamic’
; Note: Mandatory when pm is set to ‘dynamic’
; pm.min_spare_servers = 5 (コメントアウト)

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to ‘dynamic’
; Note: Mandatory when pm is set to ‘dynamic’
; pm.max_spare_servers = 35 (コメントアウト)

; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to ‘ondemand’
; Default Value: 10s
;pm.process_idle_timeout = 10s;

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify ‘0’. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500 (コメントアウトを外した)

今夜は、ここまで。

明晩は、「5. php-fpmの起動と自動起動設定」以降に取り組みます。