virtualhost configuration and API access

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
flixter
Posts: 4
Joined: Fri Jul 19, 2019 7:18 am

virtualhost configuration and API access

Post by flixter » Tue Jul 23, 2019 12:47 pm

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.

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: virtualhost configuration and API access

Post by knight-of-ni » Tue Jul 23, 2019 1:09 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

flixter
Posts: 4
Joined: Fri Jul 19, 2019 7:18 am

Re: virtualhost configuration and API access

Post by flixter » Tue Jul 23, 2019 2:41 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests