From 2ac0c5b54294bf690757d92ceed9d955edef0add Mon Sep 17 00:00:00 2001 From: Andrei Condurachi Date: Mon, 23 Nov 2020 20:51:19 +0200 Subject: [PATCH] Apache fixes --- Dockerfile | 7 ------- run.sh | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6be2893..e76d094 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,13 +131,6 @@ RUN (crontab -l; echo "* * * * * cd /var/www/html;/usr/bin/php bin/grav schedule # Cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it. RUN (crontab -l; echo "") | crontab - -# Make sure apache can read&right to docroot -RUN chown -R apache:apache /var/www -# Make sure apache can read&right to logs -RUN chown -R apache:apache /var/log/apache2 -# Allow apache user login -RUN sed -i 's/apache(.*)\/sbin\/nologin/apache\\1\/bin\/ash/g' /etc/passwd - # Provide container inside image for data persistence VOLUME ["/var/www"] diff --git a/run.sh b/run.sh index 43a00c4..22bacd6 100644 --- a/run.sh +++ b/run.sh @@ -1,4 +1,10 @@ #!/bin/sh +# Allow apache user login +sed -i 's/apache(.*)\/sbin\/nologin/apache\\1\/bin\/ash/g' /etc/passwd +# Make sure apache can read&right to docroot +chown -R apache:apache /var/www +# Make sure apache can read&right to logs +chown -R apache:apache /var/log/apache2 # Allow Apache to create pid -RUN chown -R apache:apache /run/apache2 \ No newline at end of file +chown -R apache:apache /run/apache2 \ No newline at end of file