From 2c920625a6d5258913a79f8116eb8e0ce6b998f5 Mon Sep 17 00:00:00 2001 From: lars-hagen Date: Tue, 14 Jan 2020 21:08:40 +0100 Subject: [PATCH] Changed launch command, and loop that checks if ols is running --- config/litespeed/1.6.4.lh/Dockerfile | 3 +-- config/litespeed/1.6.4.lh/entrypoint.sh | 11 ++++++++++- lsws/conf/httpd_config.conf | 3 +++ lsws/conf/httpd_config.conf0 | 7 ++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/config/litespeed/1.6.4.lh/Dockerfile b/config/litespeed/1.6.4.lh/Dockerfile index dbb485c..e564d06 100644 --- a/config/litespeed/1.6.4.lh/Dockerfile +++ b/config/litespeed/1.6.4.lh/Dockerfile @@ -28,5 +28,4 @@ COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] WORKDIR /var/www/vhosts/ -CMD ["/usr/local/lsws/bin/openlitespeed","-n"] - +CMD ["/usr/local/lsws/bin/lswsctrl","start"] diff --git a/config/litespeed/1.6.4.lh/entrypoint.sh b/config/litespeed/1.6.4.lh/entrypoint.sh index c634dc9..6b36d96 100644 --- a/config/litespeed/1.6.4.lh/entrypoint.sh +++ b/config/litespeed/1.6.4.lh/entrypoint.sh @@ -1,4 +1,13 @@ #!/bin/bash chown 999:999 /usr/local/lsws/conf -R chown 999:1000 /usr/local/lsws/admin/conf -R -exec "$@" + +#start ols and ping it every 60 second to make sure it running, if not exist container (assuming ols crashed) +$@ +while true; do + if ! /usr/local/lsws/bin/lswsctrl status | grep 'litespeed is running with PID *' > /dev/null; then + break + fi + sleep 60 +done + diff --git a/lsws/conf/httpd_config.conf b/lsws/conf/httpd_config.conf index 646b6ef..99dcb32 100644 --- a/lsws/conf/httpd_config.conf +++ b/lsws/conf/httpd_config.conf @@ -235,6 +235,9 @@ listener HTTPS { vhTemplate centralConfigLog { templateFile conf/templates/ccl.conf listeners Default, HTTP, HTTPS + member example3.com { + vhDomain example3.com,www.example3.com + } member localhost { vhDomain localhost, * diff --git a/lsws/conf/httpd_config.conf0 b/lsws/conf/httpd_config.conf0 index a5fb686..99dcb32 100644 --- a/lsws/conf/httpd_config.conf0 +++ b/lsws/conf/httpd_config.conf0 @@ -235,11 +235,12 @@ listener HTTPS { vhTemplate centralConfigLog { templateFile conf/templates/ccl.conf listeners Default, HTTP, HTTPS - member larshagen.net { - vhDomain larshagen.net + member example3.com { + vhDomain example3.com,www.example3.com } + member localhost { - vhDomain localhost + vhDomain localhost, * } }