質問
独自の Web アプリを実行するため、エッジゲートウェイで利用している Web サーバーの設定方法を教えてください。
回答
エッジゲートウェイでは、Web サーバーとして Lighttpd が動作しています。
lighttpd.conf ファイルとは別に、ユーザー独自の構成ファイルを作成し、それを使用して別のインスタンスで Lighttpd を起動することが可能です。
なお、80 番ポートは GUI で使用されているため、お客様のサービスで 80 番ポートを利用する場合は、GUI のポートを変更してください。(2.28 GUI の設定をする)
設定手順
- /etc/lighttpd に、"UserLighttpd.conf" ファイルを作成します。(GUIのポートと重複しないよう注意してください)
admin@amnimo:/etc/lighttpd$ sudo vi UserLighttpd.conf
- /lib/systemd/system に、"UserLighttpd.service" を下記の内容で作成します。
admin@amnimo:/lib/systemd/system$ sudo vi UserLighttpd.service
"UserLighttpd.service" 記載例
[Unit]
Description=Lighttpd Daemon
After=network-online.target
[Service]
Type=simple
PIDFile=/run/lighttpd.pid
ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/UserLighttpd.conf
ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/UserLighttpd.conf
ExecReload=/bin/kill -USR1 $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target - 以下のコマンドでサービスを起動します。
$ sudo systemctl enable UserLighttpd.service
$ sudo systemctl start UserLighttpd.service
コメント
0件のコメント
サインインしてコメントを残してください。