履歴:
PSGIまわり小まとめ (2)
PSGIまわり小まとめ (1)
残りはmt.psgiの処理をデーモン化すること。
参考:
Debian(Ubuntu)で サービスの起動、停止を管理するツールを調べてみた(chkconfigのかわりになるもの)
http://server-setting.info/debian/debian-like-chkconfig.html
Debian 7.1の正攻法であるinsservを使うことにする。
mt.psgiの起動にはstarmanを使う。
Package: insserv (1.14.0-5) @packages.debian.org
LSB の init.d スクリプトの依存関係情報を用いたブートシーケンス構成ツール
インストールと設定
参考:
Run Movable Type with nginx and PSGI on Debian
https://github.com/saahov/mt-starman-daemon/blob/master/README.md
> sudo aptitude install starman
次の内容をmt-starmanに保存し、適宜修正する。
https://github.com/saahov/mt-starman-daemon/blob/master/debian/mt-starman
mt-starmanで設定したpidファイルの所在をmt-config.cgi に次で追記
PidFilePath /home/miyajima/public_html/cgi/mt5/mt.pid
mt-starmanを/etc/init.d/に配置しパーミッションを設定
次で登録する。
> sudo insserv mt-starman
次で起動/停止できるはず。
> sudo service mt-starman start/stop
完了