目次
質問
独自の Web アプリを実行するため、エッジゲートウェイで利用している Web サーバーの設定方法を教えてください。
回答
エッジゲートウェイでは、Web サーバーとして Lighttpd が動作しています。
lighttpd.conf ファイルとは別に、ユーザー独自の構成ファイルを作成し、それを使用して別のインスタンスで Lighttpd を起動することが可能です。
なお、80 番ポートは GUI で使用されているため、お客様のサービスで 80 番ポートを利用する場合は、GUI のポートを変更してください。(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件のコメント
サインインしてコメントを残してください。