From 931bf8ff0f6f3d5faa4f36a57081e28902eb863c Mon Sep 17 00:00:00 2001 From: kungfu71186 Date: Tue, 29 Aug 2017 13:36:21 -0400 Subject: [PATCH 1/4] Create apache2 directory under /run Create apache2 directory under /run. --- alpine-apache/root/etc/services.d/apache/run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alpine-apache/root/etc/services.d/apache/run b/alpine-apache/root/etc/services.d/apache/run index 00904e8..339f807 100644 --- a/alpine-apache/root/etc/services.d/apache/run +++ b/alpine-apache/root/etc/services.d/apache/run @@ -1,3 +1,5 @@ #!/usr/bin/with-contenv sh +mkdir -p /run/apache2 + exec /usr/sbin/apachectl -DFOREGROUND; From 9bac53f42630bad4bb5f35f87734433836233d8c Mon Sep 17 00:00:00 2001 From: kungfu71186 Date: Tue, 29 Aug 2017 14:17:50 -0400 Subject: [PATCH 2/4] Create cont-init config file This will clear the apache2 pid and create the directory --- alpine-apache/root/etc/cont-init.d/30-config | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 alpine-apache/root/etc/cont-init.d/30-config diff --git a/alpine-apache/root/etc/cont-init.d/30-config b/alpine-apache/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..21ea4ca --- /dev/null +++ b/alpine-apache/root/etc/cont-init.d/30-config @@ -0,0 +1,7 @@ +#!/usr/bin/with-contenv bash + +mkdir -p /run/apache2 + +# clear old pid +[[ -e /run/apache2/httpd.pid ]] && \ + rm /run/apache2/httpd.pid From 2df1fad905a4e39e22659935f5a8ad6b7a055c9b Mon Sep 17 00:00:00 2001 From: kungfu71186 Date: Tue, 29 Aug 2017 14:20:03 -0400 Subject: [PATCH 3/4] Update run --- alpine-apache/root/etc/services.d/apache/run | 2 -- 1 file changed, 2 deletions(-) diff --git a/alpine-apache/root/etc/services.d/apache/run b/alpine-apache/root/etc/services.d/apache/run index 339f807..00904e8 100644 --- a/alpine-apache/root/etc/services.d/apache/run +++ b/alpine-apache/root/etc/services.d/apache/run @@ -1,5 +1,3 @@ #!/usr/bin/with-contenv sh -mkdir -p /run/apache2 - exec /usr/sbin/apachectl -DFOREGROUND; From 8b64e9d797c3fb7299a45e92313ed64269baff31 Mon Sep 17 00:00:00 2001 From: kungfu71186 Date: Tue, 29 Aug 2017 14:38:19 -0400 Subject: [PATCH 4/4] fixed type bash to sh --- alpine-apache/root/etc/cont-init.d/30-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine-apache/root/etc/cont-init.d/30-config b/alpine-apache/root/etc/cont-init.d/30-config index 21ea4ca..05ca3a4 100644 --- a/alpine-apache/root/etc/cont-init.d/30-config +++ b/alpine-apache/root/etc/cont-init.d/30-config @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv bash +#!/usr/bin/with-contenv sh mkdir -p /run/apache2