From a1f0ec3ecf2e14a9324bbff977f143e49e282ded Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Sun, 2 Apr 2017 19:42:48 -0700 Subject: [PATCH] Use misc/apache.conf instead of utils/docker/apache-vhost in docker This avoids duplication and fixes a few things that were missing in the Docker version for modern Apache: * AllowOverride All * Require all granted Deleted `ServerName @WEB_HOST@` since `WEB_HOST` was never defined in ZM code so it would give an Apache error. --- Dockerfile | 2 +- misc/apache.conf.in | 11 ++++++++++- utils/docker/apache-vhost | 14 -------------- utils/docker/setup.sh | 3 +++ 4 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 utils/docker/apache-vhost diff --git a/Dockerfile b/Dockerfile index 2c72f0f38..40f759a5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ ADD utils/docker/start.sh /tmp/start.sh RUN chown -R www-data:www-data /usr/local/share/zoneminder/ # Adding apache virtual hosts file -ADD utils/docker/apache-vhost /etc/apache2/sites-available/000-default.conf +RUN cp misc/apache.conf /etc/apache2/sites-available/000-default.conf ADD utils/docker/phpdate.ini /etc/php5/apache2/conf.d/25-phpdate.ini # Expose http ports diff --git a/misc/apache.conf.in b/misc/apache.conf.in index 5ad45338b..d1c6d70db 100644 --- a/misc/apache.conf.in +++ b/misc/apache.conf.in @@ -5,13 +5,22 @@ # Some values may need to manually adjusted to suit your setup # - ServerName @WEB_HOST@ ServerAdmin webmaster@localhost DocumentRoot "@WEB_PREFIX@" + Alias /zm/ "@WEB_PREFIX@/" Options -Indexes +FollowSymLinks AllowOverride All + + # Apache 2.4 + Require all granted + + + # Apache 2.2 + Order deny,allow + Allow from all + ScriptAlias /cgi-bin "@CGI_PREFIX@" diff --git a/utils/docker/apache-vhost b/utils/docker/apache-vhost deleted file mode 100644 index e1821932e..000000000 --- a/utils/docker/apache-vhost +++ /dev/null @@ -1,14 +0,0 @@ - - DocumentRoot /usr/local/share/zoneminder/www - DirectoryIndex index.php - - ScriptAlias /cgi-bin/ /usr/local/libexec/zoneminder/cgi-bin/ - - Require all granted - - - AllowOverride None - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - Require all granted - - diff --git a/utils/docker/setup.sh b/utils/docker/setup.sh index fbd3592f0..c7b8b121b 100755 --- a/utils/docker/setup.sh +++ b/utils/docker/setup.sh @@ -27,6 +27,9 @@ mysql -u root < db/zm_create.sql # Add the ZoneMinder DB user mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zmuser'@'localhost' identified by 'zmpass';" +# Make ZM_LOGDIR +mkdir /var/log/zm + # Activate CGI a2enmod cgi