2018年12月にAlibabaCloudの小さいなインスタンスとMT7をインストールしてみました。今度はUbuntuOSで、OpenLiteSpeed と fastCGIを選択しました。
① AlibabaCloudのお申し込み方法
1.1 はじめに
アカウントを登録した後に「Free Trial」のボタンを押します。Elastic Computing Service(ECS)のところに一番左の一番低いプランを選択しました。

次は「Try Now」のボタンを押します。
個人ブログは多言語(英語・フランス語・日本語)なのでSEO的には英語版しかやていません。

1.2 インスタンス名の変更について
先にはインスタンス名を編集しました。
「Home」(ホーム)から「Products Services」(プロダクト・サービス)を選択すると購入したアイテムリストが表示されます。ECSのインスタンスをクリックします。
もし一覧の画面にいるなら左メニューから「Instances」(インスタンス)を直接に選択してください。


1.3 セキュリティについて
ファイアウォールのルールを調整します。「Network & Security」(ネットワークとセキュリティ)の左メニューから「Security Groups」(セキュリティグループ)を選択します。

「Security Groups」の一覧画面に着いたら右側の「Add Rules」(ルール追加)のリンクをクリックします。

「Security Groups Rule」(セキュリティグループのルール)の画面に着いたら「Quick Rule Creation」(クイックルール作成)のボタンを押します。

一般的な設定で「Common Port」(ポート)のとこりには以下のポートを開きました:
- 22 (SSH)
- 80 (HTTP)
- 443 (HTTPS)
「Authorization Objects」(承認)の方にはどこでもからアクセスできるように設定しました:
0.0.0.0/0
「OK」の青ボタンを押します。

OpenLiteSpeedの管理画面は「7080」のポートでアクセスするなのでもう一回「クイックルール作成」のボタンを押してカスタムポートを開きます。
ポート:
TCP
レンジ:
7080/7080

1.4 SSH鍵の追加について
間単にSSHに繋げるようにSSHキーを追加しました。 間単にSSHに繋げるようにSSHキーを追加しました。
また左メニューから「Security Groups」の下に「SSH Key Pair」を選択します。SSHキーの一覧画面に着いたら右上の「Create SSH Key Pair」(SSH鍵ペア作成)の青ボタンを押します。

新規作成画面では「SSH Key Pair Name」(SSHキーペア名)の方にペア名を入力します。「Creation Type」(SSH鍵ペア作成)の方に「Auto-Create SSH Key Pair」(自動作成)を選択します。「OK」のボタンを押します。

次は作成したインスタンスと使用できるようにします。
一覧の画面に戻ったら「Bind」(バインド)の右リンクをクリックします。

モーダルが開いたらインスタンス名を選択して、右のやじろし「>」をクリックして、「OK」のボタンを押します。

英語版の緑文字に書いてある通りにインスタンスの再起動が必要です。
左のメニューから「Instances」を選択します。
右側の方に「More」の青いリンクをクリックして、「Instance Status」(インスタンスのステータス・状態)をホバーして、「Restart」(再起動)のリンクを押します。

モーダルが開いたら一旦「Restart」(リスタート)をこのままで選択して「OK」のボタンを押します。

一覧画面の「Status」カラムの方に再起動の進捗を確認することができます。30秒~1分たったらまた「Running」状態に戻るはずです。
LiteSpeedをインストールする方法
2.1 Ubuntuのリポジトリ追加について
wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh | bash
> --2018-11-25 23:29:37--http://rpms.litespeedtech.com/debian/enable\_lst\_debain\_repo.sh
> Resolving rpms.litespeedtech.com (rpms.litespeedtech.com)... 34.210.113.18
> Connecting to rpms.litespeedtech.com (rpms.litespeedtech.com)|34.210.113.18|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 2201 (2.1K) [application/x-sh]
> Saving to: 'STDOUT'
>
> 0% [ ] 0 --.-K/s
> detecting OS type :
> detected OS: ubuntu - 14.04
> now enable the LiteSpeed Debian Repo
> 100%[======================================>] 2,201 --.-K/s in 0s
>
> 2018-11-25 23:29:38 (361 MB/s) - written to stdout [2201/2201]
>
> register LiteSpeed GPG key
> --2018-11-25 23:29:38--http://rpms.litespeedtech.com/debian/lst\_debian\_repo.gpg
> Resolving rpms.litespeedtech.com (rpms.litespeedtech.com)... 34.210.113.18
> Connecting to rpms.litespeedtech.com (rpms.litespeedtech.com)|34.210.113.18|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 1198 (1.2K) [application/octet-stream]
> Saving to: '/etc/apt/trusted.gpg.d/lst\_debian\_repo.gpg'
>
> 100%[======================================>] 1,198 --.-K/s in 0s
>
> 2018-11-25 23:29:38 (293 MB/s) - '/etc/apt/trusted.gpg.d/lst\_debian\_repo.gpg' saved [1198/1198]
>
> --2018-11-25 23:29:38--http://rpms.litespeedtech.com/debian/lst\_repo.gpg
> Resolving rpms.litespeedtech.com (rpms.litespeedtech.com)... 34.210.113.18
> Connecting to rpms.litespeedtech.com (rpms.litespeedtech.com)|34.210.113.18|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 2336 (2.3K) [application/octet-stream]
> Saving to: '/etc/apt/trusted.gpg.d/lst\_repo.gpg'
>
> 100%[======================================>] 2,336 --.-K/s in 0s
>
> 2018-11-25 23:29:38 (324 MB/s) - '/etc/apt/trusted.gpg.d/lst\_repo.gpg' saved [2336/2336]
>
> update the repo
> Ign http://mirrors.cloud.aliyuncs.com trusty InRelease
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates InRelease
> Hit http://mirrors.cloud.aliyuncs.com trusty-security InRelease
> Hit http://mirrors.cloud.aliyuncs.com trusty Release.gpg
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/main Sources
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/universe Sources
> Ign http://rpms.litespeedtech.com trusty InRelease
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/main amd64 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/universe amd64 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/main i386 Packages
> Get:1 http://rpms.litespeedtech.com trusty Release.gpg [836 B]
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/universe i386 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/main Translation-en
> Hit http://mirrors.cloud.aliyuncs.com trusty-updates/universe Translation-en
> Get:2 http://rpms.litespeedtech.com trusty Release [1,662 B]
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/main Sources
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/universe Sources
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/main amd64 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/universe amd64 Packages
> Get:3 http://rpms.litespeedtech.com trusty/main amd64 Packages [19.2 kB]
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/main i386 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/universe i386 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/main Translation-en
> Hit http://mirrors.cloud.aliyuncs.com trusty-security/universe Translation-en
> Hit http://mirrors.cloud.aliyuncs.com trusty Release
> Hit http://mirrors.cloud.aliyuncs.com trusty/main Sources
> Get:4 http://rpms.litespeedtech.com trusty/main i386 Packages [17.2 kB]
> Hit http://mirrors.cloud.aliyuncs.com trusty/universe Sources
> Hit http://mirrors.cloud.aliyuncs.com trusty/main amd64 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty/universe amd64 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty/main i386 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty/universe i386 Packages
> Hit http://mirrors.cloud.aliyuncs.com trusty/main Translation-en
> Hit http://mirrors.cloud.aliyuncs.com trusty/universe Translation-en
> Ign http://mirrors.cloud.aliyuncs.com trusty/main Translation-en\_US
> Ign http://mirrors.cloud.aliyuncs.com trusty/universe Translation-en\_US
> Ign http://rpms.litespeedtech.com trusty/main Translation-en\_US
> Ign http://rpms.litespeedtech.com trusty/main Translation-en
> Fetched 38.9 kB in 5s (6,936 B/s)
> Reading package lists... Done
>All done, congratulations and enjoy !
2.2 LiteSpeedのインストールについて
apt-get install openlitespeed
2.3 パスワード変更について
ブラウザーで「 https://〇.〇.〇.〇:7080 」のページを開くと OpenLiteSpeedの管理画面が表示されます。

ユーザー名:
admin
パスワード:
123456
ログインした後に右上に置いてあるの言語プールダウンで「English」から「日本語」に切り替えます。
次は「admin」のパスワードを変更します。
① 左のサイドメニューから「WebAdminの設定」をクリックする。
②「一般」を選択する。
③「ユーザー」のタブを選ぶ。
④「編集」アイコンのボタンを押す。

旧パスワードのところで「123456」を入力したら下のフィールドの方に新しいパスワードを入力します。終ったら右上の「保存」ボタンをクリックします。

2.4 SSLの設定について
「Let’s Encrypt」と簡単にSSLの証明書を準備します。
先にPythonの必要なものをインストールします。
pip install virtualenv
> Downloading/unpacking virtualenv
> http://mirrors.aliyun.com/pypi/simple/virtualenv/ uses an insecure transport scheme (http). Consider using https if mirrors.aliyun.com has it available
> Downloading virtualenv-16.1.0-py2.py3-none-any.whl (1.9MB): 1.9MB downloaded
> Installing collected packages: virtualenv
> Successfully installed virtualenv
> Cleaning up...
次は自動設定のスクリプトをダウンロードして新規証明書を作成します。
wget https://dl.eff.org/certbot-auto
> --2018-11-29 10:24:27-- https://dl.eff.org/certbot-auto
> Resolving dl.eff.org (dl.eff.org)... 151.101.76.201, 2a04:4e42:12::201
> Connecting to dl.eff.org (dl.eff.org)|151.101.76.201|:443... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 62298 (61K) [application/octet-stream]
> Saving to: 'certbot-auto'
>
> 100%[======================================>] 62,298 --.-K/s in 0s
>
> 2018-11-29 10:24:28 (261 MB/s) - 'certbot-auto' saved [62298/62298]
chmod a+x certbot-auto
./certbot-auto certonly --no-bootstrap
> Creating virtual environment...
> Installing Python packages...
> Installation succeeded.
> Saving debug log to /var/log/letsencrypt/letsencrypt.log
>
> How would you like to authenticate with the ACME CA?
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 1: Spin up a temporary webserver (standalone)
> 2: Place files in webroot directory (webroot)
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
「2」のキーを押します。
> Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):
「〇〇@〇〇〇〇.〇〇〇〇」メールアドレスを入力します。
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Please read the Terms of Service at
> https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
> https://acme-v02.api.letsencrypt.org/directory
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> (A)gree/(C)ancel:
「Shift」+「a」のキーを押します。
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Would you be willing to share your email address with the Electronic Frontier
> Foundation, a founding partner of the Let's Encrypt project and the non-profit
> organization that develops Certbot? We'd like to send you email about our work
> encrypting the web, EFF news, campaigns, and ways to support digital freedom.
> \- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> (Y)es/(N)o:
「Shift」+「n」のキーを押します。
> Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel):
ドメインを入力します。
こちらは「re.movable-ti.me」に設定しました。
> Obtaining a new certificate
> Performing the following challenges:
> http-01 challenge for re.movable-ti.me
> Input the webroot for re.movable-ti.me: (Enter 'c' to cancel):
ここでは「usr/local/lsws/RemovableTime/html/」を入力しました
> Waiting for verification...
> Cleaning up challenges
>
> IMPORTANT NOTES:
> - Congratulations! Your certificate and chain have been saved at:
> /etc/letsencrypt/live/re.movable-ti.me/fullchain.pem
> Your key file has been saved at:
> /etc/letsencrypt/live/re.movable-ti.me/privkey.pem
> Your cert will expire on 2019-02-27. To obtain a new or tweaked
> version of this certificate in the future, simply run certbot-auto
> again. To non-interactively renew *all* of your certificates, run
> "certbot-auto renew"
> - If you like Certbot, please consider supporting our work by:
>
> Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
> Donating to EFF: https://eff.org/donate-le
2.5 バーチャルホストの設定について
一回ログアウトして、バーチャルホストを設定します。
デフォルトのホスト「Example」を「RemovableTime」に変更します。
cd /usr/local/lsws/
mv ./Example ./RemovableTime
mv ./conf/vhosts/Example ./conf/vhosts/RemovableTime/
SFTPでMT7版をgithubからダウンロードしてサーバーにアップします:
- /usr/local/lsws/RemovableTime/cgi-bin/mt/
- /usr/local/lsws/RemovableTime/html/mt-static/
とりあえずファイルパーミッションを簡単に調整します。
デフォルトにOpenLiteSpeedは「nobody」のユーザー名と「nogroup」のグループ名で動いています。
cd /usr/local/lsws/RemovableTime/
chmod -R 744 ./html
chown -R nobody:nogroup ./html/
chmod -R 755 ./cgi-bin/
chown -R nobody:nogroup ./cgi-bin/
744:
- オナー:RWX
- 以外:R–
755:
- オナー:RWX
- 以外:R-X
管理画面をまたログインして、バーチャルホストを調整します。
左のメニューから「バーチャルホスト」を選択します。
右側の編集アイコンをクリックします。

2.5.1 バーチャルホストの「基本」設定について
もし「Example」の文字が残っていますなら「基本」のところのみを調整する。先ほど決めた設定をフィールドホスト名などを変更します:
バーチャルホスト名:
RemovableTime
Virtual Host Root
$SERVER_ROOT/RemovableTime/
設定ファイル:
$SERVER_ROOT/conf/vhosts/RemovableTime/vhconf.conf

2.5.2 バーチャルホストの「一般」設定について
「一般」のタブはこのままで変更なしで。
Document Root:
$VH_ROOT/html/
インデックスファイル:
いいえ
2.5.3 バーチャルホストの「ログ」設定について
このままで大丈夫です。
2.5.4 「セキュリティ」の設定について
このままで大丈夫です。
2.5.5 バーチャルホストの「外部アプリ」設定について
そこでは「FastCGI」を有効にします。
右上の「+」アイコン(追加)をクリックします。

プールダウンのところで「FastCGI」を選んで「次へ」のアイコンを押します。

以下の設定を入力します:
アドレス:UDS://tmp/lshttp/fcgi.socket
最大接続数:10
初期リクエストタイムアウト(秒) :1000
リトライタイムアウト(秒) :0
永続的な接続:はい
応答バッファリング:いいえ
自動起動:はい
インスタンス:1
メモリソフトリミット(バイト):80
メモリハードリミット(バイト):100
プロセスソフトリミット:200
プロセスハードリミット:200
終ったらまた保存のボタンを押します。

2.5.6 バーチャルホストの「スクリプトハンドラー」設定について
ここではCGIのファイルをFastCGIの方に動かすようにします。
「+」の追加アイコンをクリックします:

「cgi」のサフィックスを入力します:
cgi
ハンドラータイプのプールダウンの方には「FastCGI」を選択します:
FastCGI
ハンドラ名のプールダウンの方には作成した外部アプリを選択します:
[VHostレベル]: RemovableTimeCGI

2.5.7 バーチャルホストの「Rewrite」設定について
このままで大丈夫です。
2.5.8 バーチャルホストの「コンテキスト」設定について
以下の設定のみを残しておきます:
1)「/」のスタティックフォルダー
2)「/cgi-bin/」のCGIフォルダー

2.5.9 バーチャルホストの「SSL」設定について
「SSL」は先ほど作成した証明書を追加します。SSLのタブをクリックしたら以下の値を入力します:
秘密鍵ファイル:
/etc/letsencrypt/live/〇〇〇〇/privkey.pem
証明書ファイル:
/etc/letsencrypt/live/〇〇〇〇/cert.pem

2.5.10 バーチャルホストの「Web Socket Proxy」設定について
なしでこのままで大丈夫です。
2.5.11 バーチャルホストの「モジュールy」設定について
なしでこのままで大丈夫です。
2.6 リスナーの変更について
左メニューから「リスナー」を選択します。
右側にある詳細アイコンをクリックします。

一般の設定画面に着いたら、また右上の編集アイコンをクリックします。

リスナ名を「RemovableTime」に変更しました。
ポートを「80〇〇」から「443」に変更して保存します。
セキュアのラジオボタンを「はい」に選択します。

まだ再起動しなくても大丈夫です。
次は「Let’s Encrypt」作成した証明書を追加します。同じ管理画面で「一般」のとなりにある「SSL」のタブを選択します。SSLの管理画面に着いたら「 SSL 秘密鍵 & 証明書」の編集アイコンをクリックします。

秘密鍵と証明書の編集ボタンを押します。
バーチャルホストと同じ設定を入力しました。
秘密鍵ファイル:
/etc/letsencrypt/live/〇〇〇〇/privkey.pem
証明書ファイル:
/etc/letsencrypt/live/〇〇〇〇/cert.pem
入力が終ったら「保存」ボタンを必ず押します。

2.7 再起動について
一度OpenLiteSpeedのみを再起動します。
管理画面の一番右上の緑アイコンをクリックすればいいです。

③ MariaDBのインストールについて
3.1 Ubuntuのリポジトリ追加について
apt-get install mariadb-server
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following extra packages will be installed:
> libdbd-mysql-perl libdbi-perl libhtml-template-perl libmariadbclient18
> libmysqlclient18 libreadline5 libterm-readkey-perl mariadb-client-5.5
> mariadb-client-core-5.5 mariadb-common mariadb-server-5.5
> mariadb-server-core-5.5 mysql-common
> Suggested packages:
> libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl
> libsql-statement-perl libipc-sharedcache-perl mariadb-test tinyca
> The following NEW packages will be installed:
> libdbd-mysql-perl libdbi-perl libhtml-template-perl libmariadbclient18
> libmysqlclient18 libreadline5 libterm-readkey-perl mariadb-client-5.5
> mariadb-client-core-5.5 mariadb-common mariadb-server mariadb-server-5.5
> mariadb-server-core-5.5 mysql-common
> 0 upgraded, 14 newly installed, 0 to remove and 4 not upgraded.
> Need to get 11.9 MB of archives.
> After this operation, 121 MB of additional disk space will be used.
> Do you want to continue? [Y/n] Y
> Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/main mysql-common all 5.5.62-0ubuntu0.14.04.1 [12.6 kB]
> Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-common all 5.5.61-1ubuntu0.14.04.1 [12.9 kB]
> Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe libmariadbclient18 amd64 5.5.61-1ubuntu0.14.04.1 [533 kB]
> Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/main libmysqlclient18 amd64 5.5.62-0ubuntu0.14.04.1 [598 kB]
> Get:5 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty/main libreadline5 amd64 5.2+dfsg-2 [130 kB]
> Get:6 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty/main libdbi-perl amd64 1.630-1 [879 kB]
> Get:7 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty/main libterm-readkey-perl amd64 2.31-1 [27.4 kB]
> Get:8 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-client-core-5.5 amd64 5.5.61-1ubuntu0.14.04.1 [637 kB]
> Get:9 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-client-5.5 amd64 5.5.61-1ubuntu0.14.04.1 [978 kB]
> Get:10 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-server-core-5.5 amd64 5.5.61-1ubuntu0.14.04.1 [3,849 kB]
> Get:11 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-server-5.5 amd64 5.5.61-1ubuntu0.14.04.1 [4,051 kB]
> Get:12 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/main libdbd-mysql-perl amd64 4.025-1ubuntu0.1 [87.6 kB]
> Get:13 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty/main libhtml-template-perl all 2.95-1 [65.5 kB]
> Get:14 http://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates/universe mariadb-server all 5.5.61-1ubuntu0.14.04.1 [11.7 kB]
> Fetched 11.9 MB in 2s (4,622 kB/s)
> Preconfiguring packages ...
> Selecting previously unselected package mysql-common.
> (Reading database ... 99983 files and directories currently installed.)
> Preparing to unpack .../mysql-common_5.5.62-0ubuntu0.14.04.1_all.deb ...
> Unpacking mysql-common (5.5.62-0ubuntu0.14.04.1) ...
> Selecting previously unselected package mariadb-common.
> Preparing to unpack .../mariadb-common_5.5.61-1ubuntu0.14.04.1_all.deb ...
> Unpacking mariadb-common (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package libmariadbclient18:amd64.
> Preparing to unpack .../libmariadbclient18_5.5.61-1ubuntu0.14.04.1_amd64.deb ...
> Unpacking libmariadbclient18:amd64 (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package libmysqlclient18:amd64.
> Preparing to unpack .../libmysqlclient18_5.5.62-0ubuntu0.14.04.1_amd64.deb ...
> Unpacking libmysqlclient18:amd64 (5.5.62-0ubuntu0.14.04.1) ...
> Selecting previously unselected package libreadline5:amd64.
> Preparing to unpack .../libreadline5_5.2+dfsg-2_amd64.deb ...
> Unpacking libreadline5:amd64 (5.2+dfsg-2) ...
> Selecting previously unselected package libdbi-perl.
> Preparing to unpack .../libdbi-perl_1.630-1_amd64.deb ...
> Unpacking libdbi-perl (1.630-1) ...
> Selecting previously unselected package libterm-readkey-perl.
> Preparing to unpack .../libterm-readkey-perl_2.31-1_amd64.deb ...
> Unpacking libterm-readkey-perl (2.31-1) ...
> Selecting previously unselected package mariadb-client-core-5.5.
> Preparing to unpack .../mariadb-client-core-5.5_5.5.61-1ubuntu0.14.04.1_amd64.deb ...
> Unpacking mariadb-client-core-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package mariadb-client-5.5.
> Preparing to unpack .../mariadb-client-5.5_5.5.61-1ubuntu0.14.04.1_amd64.deb ...
> Unpacking mariadb-client-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package mariadb-server-core-5.5.
> Preparing to unpack .../mariadb-server-core-5.5_5.5.61-1ubuntu0.14.04.1_amd64.deb ...
> Unpacking mariadb-server-core-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
> Setting up mysql-common (5.5.62-0ubuntu0.14.04.1) ...
> Setting up mariadb-common (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package mariadb-server-5.5.
> (Reading database ... 100318 files and directories currently installed.)
> Preparing to unpack .../mariadb-server-5.5_5.5.61-1ubuntu0.14.04.1_amd64.deb ...
> Unpacking mariadb-server-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Selecting previously unselected package libdbd-mysql-perl.
> Preparing to unpack .../libdbd-mysql-perl_4.025-1ubuntu0.1_amd64.deb ...
> Unpacking libdbd-mysql-perl (4.025-1ubuntu0.1) ...
> Selecting previously unselected package libhtml-template-perl.
> Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
> Unpacking libhtml-template-perl (2.95-1) ...
> Selecting previously unselected package mariadb-server.
> Preparing to unpack .../mariadb-server_5.5.61-1ubuntu0.14.04.1_all.deb ...
> Unpacking mariadb-server (5.5.61-1ubuntu0.14.04.1) ...
> Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
> Processing triggers for ureadahead (0.100.0-16) ...
> ureadahead will be reprofiled on next reboot
> Setting up libmariadbclient18:amd64 (5.5.61-1ubuntu0.14.04.1) ...
> Setting up libmysqlclient18:amd64 (5.5.62-0ubuntu0.14.04.1) ...
> Setting up libreadline5:amd64 (5.2+dfsg-2) ...
> Setting up libdbi-perl (1.630-1) ...
> Setting up libterm-readkey-perl (2.31-1) ...
> Setting up mariadb-client-core-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Setting up mariadb-client-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Setting up mariadb-server-core-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> Setting up mariadb-server-5.5 (5.5.61-1ubuntu0.14.04.1) ...
> \* Stopping MariaDB database server mysqld [ OK ]
> chown: cannot access '/var/run/mysqld': No such file or directory
> 181126 0:04:03 [Note] /usr/sbin/mysqld (mysqld 5.5.61-MariaDB-1ubuntu0.14.04.1) starting as process 5378 ...
> \* Starting MariaDB database server mysqld [ OK ]
> \* Checking for corrupt, not cleanly closed and upgrade needing tables.
> Setting up libdbd-mysql-perl (4.025-1ubuntu0.1) ...
> Setting up libhtml-template-perl (2.95-1) ...
> Processing triggers for ureadahead (0.100.0-16) ...
> Setting up mariadb-server (5.5.61-1ubuntu0.14.04.1) ...
> Processing triggers for libc-bin (2.19-0ubuntu6.14) ...
3.2 新しいデーターベースの設定について
mysql -u root -p
Enter password:
「removable7」の新データベース作成:
MariaDB [(none)]> CREATE DATABASE removable7; Query OK, 1 row affected (0.00 sec)
「removable7」の新ユーザー追加:
ユーザー名: removable7
パスワード: 123456
MariaDB [(none)]> CREATE USER 'removable7'@'localhost' IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.00 sec)
「removable7」が「removable7」のデータベースを変更できるように:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON removable7.* TO 'removable7'@'localhost'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
別のホストから書き出しているファイルをインポートします。(dump)
MariaDB [(none)]> USE removable7;
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 [removable7]> SOURCE dump.sql
….
④「Movable Type」のインストールについて
4.1 Perlモジュールの追加について
apt-get install libarchive-zip-perl
apt-get install libdbd-mysql
apt-get install libimager-perl
apt-get install libxml-*-perl
4.2 設定について
サーバー移動なので設定ファイルを共有します:
> ## Movable Type Configuration File
> ##
> ## This file defines system-wide
> ## settings for Movable Type. In
> ## total, there are over a hundred
> ## options, but only those
> ## critical for everyone are listed
> ## below.
> ##
> ## Information on all others can be
> ## found at:
> ## https://www.movabletype.org/documentation/config
>
> #======== REQUIRED SETTINGS ==========
> CGIPath /cgi-bin/mt/
> StaticWebPath /mt-static/
> StaticFilePath /usr/local/lsws/RemovableTime/html/mt-static
>
> #======== DATABASE SETTINGS ==========
> ObjectDriver DBI::mysql
> Database removable7
> DBUser removable7
> DBPassword 123456
> DBHost localhost
>
> #======== MAIL =======================
> EmailAddressMain noreply@example.com
> MailTransfer sendmail
> MailEncoding UTF-8
> SendMailPath /usr/lib/sendmail
>
> #======== PERMISSIONS ================
> HTMLPerms 0644
> DirUmask 0022
>
> DefaultLanguage en
> PublishCharset UTF-8
>
> EntriesPerRebuild 5
> ImageDriver Imager
> SSLVerifyNone 1
AlibabaECSはメールを送信することができませんので外部サービスのrelay設定が必須でございます。(例:sendgrid)
4.3 公開キューの設定について
EntriesRebuildを調整しないとMT7の場合はエラー500になってしまいます。
調整をしたくなくても公開キュー使用できるの準備して方が良いと思います:
touch /usr/local/lsws/RemovableTime/logs/mt.log
crontab -e
一時間毎に二回再構築できるようにしておきます:
0,30 * * * * cd /usr/local/lsws/RemovableTime/cgi-bin/mt; perl ./tools/run-periodic-tasks -verbose >> /usr/local/lsws/RemovableTime/logs/mt.log