This commit is contained in:
AnsibleGuy 2022-05-11 20:43:21 +02:00
parent 71c6517b92
commit af927f5922
2 changed files with 10 additions and 12 deletions

View File

@ -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:

View File

@ -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"
<Directory "/usr/lib/zoneminder/cgi-bin">
ScriptAlias /zm/cgi-bin "{{ ZM_CONFIG.path.cgi }}"
<Directory "{{ ZM_CONFIG.path.cgi }}">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>
# Order matters. This alias must come first.
Alias /zm/cache "/var/cache/zoneminder"
<Directory "/var/cache/zoneminder">
Alias /zm/cache "{{ ZM_CONFIG.path.cache }}"
<Directory "{{ ZM_CONFIG.path.cache }}">
Options -Indexes +FollowSymLinks
AllowOverride None
<IfModule mod_authz_core.c>
@ -21,30 +19,29 @@ ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
</IfModule>
</Directory>
Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
Alias /zm {{ ZM_CONFIG.path.web }}
<Directory {{ ZM_CONFIG.path.web }}>
Options -Indexes +FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>
# fix for /zm/api throwing 404 => https://github.com/turnkeylinux/tracker/issues/1623
<Directory "/usr/share/zoneminder/www/api">
<Directory "{{ ZM_CONFIG.path.web }}/api">
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</Directory>
<Directory "/usr/share/zoneminder/www/api/app">
<Directory "{{ ZM_CONFIG.path.web }}/api/app">
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /zm/api
</Directory>
<Directory "/usr/share/zoneminder/www/api/app/webroot">
<Directory "{{ ZM_CONFIG.path.web }}/api/app/webroot">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f