自作サーバーへのKUSANAGI for VMware導入備忘録、【其の一】
この記事を読むのに必要な時間は約 14 分です。
[注意事項]はじめに・おことわり
超高速WordPress仮想マシン「KUSANAGI」を
自作サーバーに導入するため、予行演習したときについでに作った備忘録です。
(登場する仮想マシンも予行演習用です。現在の当サイトを動かしている本番環境ではありません)
なお、画像内の各設定値はこの記事のために準備したフェイクなものです(FQDNとメアドだけ除く)。
もしまねをされる方は設定値を適宜読み替えてください。
ただ、手順を書いたことによって悪い心を刺激されて、「ハックして私のサイトをダウン」とか「サイトをぶっ壊すぶっ壊すぶっ壊~す🔨」なんて考えないでくださいね。 アクセスログ見てます(# ゚Д゚)
※企業がKUSANAGIを導入するときは、法人向けネットワーク機器(ファイアウォール)を用いる一方、当方は個人宅で家庭用ネットワーク機器なので……
本来、KUSANAGIはVMwareWorkstationProでしか動作保証されていません。
ですがWorkstationProが高価なのと、個人宅にて非営利個人利用なので中の人の自己責任にてWorkstationPlayerで構築しています。
この記事の内容をまねされたことに伴う、
発生しうる不具合や損害の責任は一切負えません。
自己責任でお願いします
あくまでもこの記事は個人の備忘録です 。
この記事はパソコンで見ることを前提に、画像サイズを大きくしてあります。
一応各画像はクリックで拡大しますが。
画像が多いです。モバイルデータ通信ではこれ以降の表示はお勧めできません。(Wi-Fiか、有線LAN推奨)
KUSANAGI構築のための手順すべては現時点では書けていません。【其の二の途中が途中書き】
下準備
VMwareのインストール
https://www.vmware.com/jp/products/workstation-player.html
途中の
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/544273d04f17e3b8ac10aeddc7a6319d.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/eb22bf7a906b7f73af3d68cd620dade7.png)
Chromeのインストール
https://www.google.com/chrome/
後に出てくるディスクイメージ取得の手順で、Chromeじゃないとうまくいきませんので必ず入れる。
(詳しくは以下)
本作業
KUSANAGI for VMwareを導入し、とりあえず起動するところまでもっていく
KUSANAGI for VMwareディスクイメージの取得
https://kusanagi.tokyo/cloud/kusanagi-for-vmware/
上のサイトをChromeで開き、リンクよりディスクイメージをダウンロード。
CentOS7.2_64_kusanagi7.8.3.ovaを確認
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/97f7ec491db5149823537f26fe6cfdb1.png)
KUSANAGI for VMwareセットアップ
VMware起動
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/ec18989bd1df7c7f5184ada005fc7f4c.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/ee5991c03be8ddb7e5b350dc085e5740.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/70f798d02249a91dd48aec09cf13c97d.png)
仮想マシンを開くクリック
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/000e184c36efdfac7d68ab04404857e5.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/552b842fb5e625124e772e3c1e1c9f09.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/6e91ec1bb7ff4ab78954bdc9e4ab99ce.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/508f060a294f87be0e86114cdbe8588b.png)
起動する。
(ホストとゲスト間のVMware側のネットワーク設定は、適宜「仮想マシンの設定」より、起動前に設定を済ますこと)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/f2092c08684b8d64cc1b8ab781254c7e024x688.png)
KUSANAGI for VMwareの初期設定以前の基本的な部分
rootパスワード変更
2-5.NW設定を各自分の環境に合わせます。
KUSANAGI for VMware
初期設定として以下が設定されています。
初期RootPassword:4XhXygXW9nAdisDb
https://kusanagi.tokyo/cloud/kusanagi-for-vmware/#Workstation12Pro
より引用
だそうだ。
パスワード放り込んで
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/b322e4bca000b4b9c02cc6aaf05bfdf8.png)
ログイン完了
だが
初期パスワードのままだと超危険なので変更する。
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/989ead7fcd1354aa7ba8d4802e12a558.png)
念のためいったんログアウトして再ログインを試みる。
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/1bc74be4b8f9958df55aae150b2e7eb6.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/c8a683da9f4207a627a76cdd793e7f0a.png)
ゲストOS側のネットワーク設定の確認と設定
NETWORK初期設定
NIC:ブリッジ
IP:192.168.123.193
MASK:255.255.255.0
Gateway:192.168.123.254
KUSANAGI for VMware
https://kusanagi.tokyo/cloud/kusanagi-for-vmware/#Workstation12Pro
より引用
だそうだ
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/2e022127b9467db42382966378e841f4-1024x787.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/f3b678ce2f4cb5df254d746ee8c3592d-1024x787.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/a09af9f42d6e6aab4bd793cbd185f311-1024x787.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/f2092c08684b8d64cc1b8ab781254c7e-1024x787.png)
KUSANAGI側でIPアドレスを固定にするので、IPv4 CONFIGRATIONがManualになっているか確認。
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/e216137c5a7c5b3a68c696d0288115e6.png)
万が一なっていなければ変更する
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/937a6dd455d734610c0fee7611f367ce.png)
各入力欄をKUSANAGIを導入する環境にあわせて適切な値を入力すること。
【項目名】 | 【デフォ値】 | 【→】 | 【入力値 例】 |
Addresses | 192.168.123.193/24 | → | XXX.XXX.XXX.XX/24(本機KUSANAGIのIP) |
Gateway | 192.168.123.254 | → | XXX.XXX.XXX.XX(ルーターのIP) |
DNS servers | 192.168.123.254 | → | XXX.XXX.XXX.XX(ルーターのIP、またはプロバイダからルーターに指定されたプロバイダDNSなど) |
念のため、ルーター側からもIPを固定してやります。
ツイッターの相互フォローみたいな関係にしてやるってことね
《KUSANAGI》⇄《ルーター》
ルーターログインOPEN
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/72950806ba1ca361df6671259487d164.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/6a8255c909a794f147b6b97aa0c0ab58.png)
いったんKUSANAGIを再起動してやります
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/d44c5ad075375060b751bfb8a0fe9821.png)
いよいよKUSANAGI初期設定
https://kusanagi.tokyo/document/kusanagi-init/
上の本家の解説サイトの手順に従ってセットアップしていきます。
CentOS標準にはないKUSANAGIというコマンドもあるそうで、自分でLAMP環境から構築するよりも手数が少なくて済む。
ありがたすぎる高速WordpressKUSANAGI。感謝です( ´∀` )
アップデートの確認
KUSANAGIコマンドによる初期設定を行う前に、まずCentOSやKUSANAGIシステムのアップデートを yum を利用して行います。
次のように入力し、アップデートを開始します。KUSANAGIの初期設定
# yum --enablerepo=remi,remi-php56 update -y
https://kusanagi.tokyo/document/kusanagi-init/
より引用
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/bbeb821b69c191abaee14de89961877e.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/ee5991c03be8ddb7e5b350dc085e5740.png)
終わったら再起動
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/bbac851e18767a427038d9e88ed6b025.png)
なんか設定でつまづいたり
最初こう入力しちゃってたけど↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/6eed3d87c574acc257a3ca6fe2ecebab.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/8192f8d1096ae48b483986d7326129d2.png)
kusanagi init [options]の[ ]って
「そこにコマンドが入りますよー」って意味だったみたい…
2. TLS用ホスト鍵ファイルの生成
KUSANAGIの初期設定
TLSセッションチケットファイル、DH(Diffie-Hellman)鍵交換で使用するパラメータファイルを生成します。
これらのファイルは /etc/kusanagi.d/ssl 下に生成され、すでに生成しているときは再生成しません。
マシンの性能によっては、このファイル生成に数分かかることがありますので、ご注意ください。
https://kusanagi.tokyo/document/kusanagi-init/
より引用
っていうのは後で行われる3. サーバタイムゾーンの設定のことについての説明だったのね。てっきりkusanagi init [options]入れたらウィザードみたいに対話的な設定が出てきて2. TLS用ホスト鍵ファイルの生成がされるのかなって思っちゃった( ´∀` )
まーいいわ、次の手順いきましょ
タイムゾーンの設定など
タイムゾーンの設定をしたいので
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/ebc8069a1754dea8bff901f4ef43fd29.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/bae37a8f51a0ba76f3502e54cc1a408c.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/8bc25077b38e424a3912fe71184afab3.png)
そうこうしているうちに終わってた。
どうやらタイムゾーン設定をしただけで、自動的に一連の設定を行うウィザードが始まってしまうようだ↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/9bfb2d1a7f42f897af71d62e1e51bcba.png)
Select your using languageなので言語を選べってことだね。
2:■ ■ ■ってのは文字化けしてる日本語っぽいねw
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/fddfdd90c797d6ecdcce73dec5575855.png)
で、キーボードタイプ(キーボードレイアウト)を聞かれる↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/36511a4cc55f14b78e4e206b0c432259.png)
ほう、
kusanagiというユーザーが標準アカウントになるのね。(rootとは違う、Wordpressとかを扱うためのっぽい)
それのパスワードを入れんさいって。↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/20aedded54db34ae7b2d8dcd767ced62.png)
お次はSSHのユーザー認証鍵↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/22827e281198683f9638806471c28711.png)
認証キーできたら、
NGINXとApacheどっち使うか聞かれる ↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/d44c5ad075375060b751bfb8a0fe9821.png)
その後 PHPとかどーすんのーときかれる↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/7f34ec4fa1689acaf486a2e9713e3ebb.png)
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/c8f0ecf46cfde2a64ac298a885a244a2-1024x397.jpg)
さっきのネットワーク設定が適切でなかったら、
リポジトリにつながらない状態になり
以下の画像のようにエラー吐きます。
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/d4f6d8860ab1dbed57a4ea6d9b46f9f9-150x150.png)
PHPが終わるとRubyどうすんのーって聞かれる↓
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/d0f89823f0938883eb607beaf59b843d.png)
選択肢が一つ(Ruby2.4)しかないのに聞いてくるのね っと思っちゃった
確認のためだろ
でデータベースどうするか聞かれる
![](https://torisamaahirusama.com/wp-content/uploads/2019/08/d4c537b067795bf379b67ecde91bae10.png)
その後 mysqlのrootパスワード入れろと言われるので任意のパスワードをいれます
MariaDBが見つからないよっていうエラーがでますが大丈夫です。
さっきのPHPの時と同様、ネットワークがおかしいと後でエラー出てしまいますが、
正しいネットワーク設定ならば、
次の画像のようにパスワード入力後、無くなってるMariaDBを充てて(Upgrade)くれます
![](https://i1.wp.com/torisamaahirusama.com/wp-content/uploads/2019/09/MariaDBokikae.jpg?fit=750%2C603&ssl=1)
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/741702c9f0535ca4e80c4b77809059a3.jpg)
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/a4b478180a3b399ab662b3948a775153-150x150.png)
クリックで拡大
![](https://torisamaahirusama.com/wp-content/uploads/2019/09/fba46f049a2aa546705f9083b3035f97.jpg)
長くなるので次の手順は別記事に
コマンドとその振る舞いを参考にさせていただいたサイト
https://server-setting.info/centos/network-config-c7.html
画像モザイク
https://i-think-it.net/windows-image-mosaic-mspaint/
投稿者プロフィール
![大須依存症名古屋人](https://torisamaahirusama.com/wp-content/uploads/2019/10/Screenmemo_2019-10-23-21-08-43-150x128.png)
最新の投稿
お知らせ2023年11月13日【お知らせ】長期メンテナンスの予定(12/22追記:いったん保留)
名市交/地下鉄2022年7月31日卒業制作として「CADで電車(鶴舞線3000形)を作った」話
日曜大工(DIY)2022年2月21日祖父母宅の洗面所灯を交換
お知らせ2022年2月21日ブログ公式LINEアカウントを作りました。