diff --git a/defaults/main.yml b/defaults/main.yml index b928831..12618c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -35,6 +35,7 @@ default_zm: conf: '/etc/zm' web: '/usr/share/zoneminder/www' cgi: '/usr/lib/zoneminder/cgi-bin' + cache: '/var/cache/zoneminder' apache: # domain: diff --git a/templates/etc/apache2/conf-available/zoneminder.conf.j2 b/templates/etc/apache2/conf-available/zoneminder.conf.j2 index a67b73a..54b69c4 100644 --- a/templates/etc/apache2/conf-available/zoneminder.conf.j2 +++ b/templates/etc/apache2/conf-available/zoneminder.conf.j2 @@ -2,17 +2,15 @@ # ansibleguy.sw_zoneminder # source: https://github.com/ZoneMinder/zoneminder/tree/master/misc -# Remember to enable cgi mod (i.e. "a2enmod cgi"). -ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" - +ScriptAlias /zm/cgi-bin "{{ ZM_CONFIG.path.cgi }}" + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch AllowOverride All Require all granted - # Order matters. This alias must come first. - Alias /zm/cache "/var/cache/zoneminder" - + Alias /zm/cache "{{ ZM_CONFIG.path.cache }}" + Options -Indexes +FollowSymLinks AllowOverride None @@ -21,30 +19,29 @@ ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" -Alias /zm /usr/share/zoneminder/www - +Alias /zm {{ ZM_CONFIG.path.web }} + Options -Indexes +FollowSymLinks DirectoryIndex index.php -# fix for /zm/api throwing 404 => https://github.com/turnkeylinux/tracker/issues/1623 - + RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] RewriteBase /zm/api - + RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] RewriteBase /zm/api - + RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f