Page 1 of 1

virtualhost configuration and API access

Posted: Tue Jul 23, 2019 12:47 pm
by flixter
Hi! I have installed ZM 1.32.3 on debian stable, via apt. I have set up a virtualhost for my apache that looks like

<VirtualHost 192.168.0.2:443>
ServerAdmin admin@mydomain.org
ServerName zm.mydomain.org

DocumentRoot /usr/share/zoneminder/www

CustomLog ${APACHE_LOG_DIR}/zm.log vhost_ssl

ScriptAlias /cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>

<Directory /usr/share/zoneminder/www>
php_flag register_globals off
Options -Indexes +FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
AllowOverride All
# Require all granted
</Directory>
</VirtualHost>

The web interface can be accessed properly, configured and so... however, when I try going zm.mydomain.org/api/host/getVersion.json I get a 404 error... and zmNinja can not access the API neither. For what is worth, I see that no .htaccess files are in any place on the tree. Does anybody know how to fix this situation?

Thank you.

Re: virtualhost configuration and API access

Posted: Tue Jul 23, 2019 1:09 pm
by knight-of-ni
Just had this conversation here:
viewtopic.php?f=38&t=28409&p=111243#p111216

The short answer is that the package you installed does not have an up to date zm Apache config.

Re: virtualhost configuration and API access

Posted: Tue Jul 23, 2019 2:41 pm
by flixter
Indeed, shortly after the post I found out on ZM repo in github a perl script that generates the virtualhost file. I adapted mine and... all works, now.

Thank you anyway for your answer :)

Felix