SKIPをlighttpdで動かす

ここでは、OS起動と同時にSKIPが立ち上がる事を目的とし、

ruby ./script/server -p [initial_settings.ymlで指定したSKIP起動ポート] -e production

で正しく動作する事を確認したSKIPをlighttpdで動かす方法を書きます。
また、この作業をする上でSKIPは停止させておいて下さい。


必要に応じて、以下を見て下さい。


あっ! 自己責任でお願いしますね。


なお、SKIPのインストールディレクトリを「%SKIP_INSTALL_PATH%」と記述しますので適宜読み替えて下さい
(なんかWindowsっぽいな... ま、いっか)。

%SKIP_INSTALL_PATH%/config/lighttpd.conf の編集

# cp %SKIP_INSTALL_PATH%/config/lighttpd.conf %SKIP_INSTALL_PATH%/config/lighttpd.conf.sample
# vi %SKIP_INSTALL_PATH%/config/lighttpd.conf

  • 以下の行を削除(これらは後程/etc/lighttpd/lighttpd.confで設定します)
    • server.bind
    • server.port
    • server.pid-file
    • server.errorlog
    • accesslog.filename
  • 以下の行で記載されている 「CWD + "パス"」を「"%SKIP_INSTALL_PATH%/パス"」に変更する
    • server.document-root
    • fastcgi.server
      • socket
      • bin-path
    • Caches Space のところ(全文検索HyperEstraierを使用する場合)
      • server.document-root
      • alias.url
/etc/lighttpd/lighttpd.conf の編集

# mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.dist
# vi /etc/lighttpd/lighttpd.conf ※要は新規作成

server.username         = "lighttpd"
server.groupname        = "lighttpd"

server.bind = "0.0.0.0"
server.port = [initial_settings.ymlで指定したSKIP起動ポート]

server.pid-file          = "/var/run/lighttpd.pid"
server.errorlog          = "/var/log/lighttpd/error.log"
accesslog.filename       = "/var/log/lighttpd/access.log"


include "%SKIP_INSTALL_PATH%/config/lighttpd.conf"
関連ディレクトリ作成&オーナー変更

# mkdir %SKIP_INSTALL_PATH%/tmp/sockets %SKIP_INSTALL_PATH%/tmp/share_file_path
# chown -R lighttpd:lighttpd %SKIP_INSTALL_PATH%
# mkdir /var/log/lighttpd ※無ければ作成
# chown -R lighttd:lighttpd /var/log/lighttpd

ちょこちょこ変更

ar_sendmailの起動停止を(強引に!?)lighttpd起動スクリプトに書きます。

# vi /etc/init.d/lighttpd

  • start() 行の下に追加
cd %SKIP_INSTALL_PATH% && /usr/bin/ar_sendmail -e production -p /var/run/ar_sendmail.pid -d > /dev/null 2>&1
  • stop() 行の下に追加
/bin/kill -9 `cat /var/run/ar_sendmail.pid` && rm -f /var/run/ar_sendmail.pid > /dev/null 2>&1
SKIP起動

# service lighttpd start
# checkconfig lighttpd on