API returns error 500

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
moennich
Posts: 2
Joined: Mon Sep 19, 2022 7:04 pm

API returns error 500

Post by moennich »

I'm trying to call an api on Zoneminder v1.36.26 in Debian Bullseye, but it does not work, returning:

Code: Select all

curl -XPOST -d "user=moennich&pass=temp" http://192.168.111.14/zm/api/host/getVersion.json

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 webmaster@localhost to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.56 (Debian) Server at 192.168.111.14 Port 80</address>
</body></html>

Code: Select all

tail -f /var/log/apache2/error.log

[Fri Apr 28 21:31:33.955885 2023] [core:error] [pid 3315] [client 192.168.111.40:49254] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Apache configuration:

Code: Select all

nano /etc/apache2/conf-enabled/zoneminder.conf

# Remember to enable cgi mod (i.e. "a2enmod cgi").
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    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">
        Options -Indexes +FollowSymLinks
        AllowOverride None
        <IfModule mod_authz_core.c>
           # Apache 2.4
           Require all granted
        </IfModule>
    </Directory>

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

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
    RewriteEngine on
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
    RewriteBase /zm/api
</Directory>

<Directory /usr/share/zoneminder/www/api/app>
    RewriteEngine on
    RewriteRule ^$ webroot/ [L]
    RewriteRule (.*) webroot/$1 [L]
    RewriteBase /zm/api
</Directory>
Any help is welcome.
Post Reply