Zoneminder 1.36.33 on Ubuntu 24.04.1 LTS with Php 8.3

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
stealthylabs
Posts: 2
Joined: Tue Oct 01, 2024 5:16 pm

Zoneminder 1.36.33 on Ubuntu 24.04.1 LTS with Php 8.3

Post by stealthylabs »

Hello Zoneminder community
I have installed Zoneminder on a dedicated amd64 computer with Ubuntu 24.04.1 LTS installed. Zoneminder 1.36.33 was available as a package from the OS repositories so I installed that, since the PPA did not support Ubuntu 24.04.

Everything went smoothly, I was able to add 3 cameras and watch and record in realtime for 24 hours.

However, while setting up zmNinja on iOS I saw that the API was not working. I have setup all the required flags and the hash keys for the API to work, have custom users, and all of them have the API enabled. I also have run `chmod` on `/usr/share/zoneminder/www` for `www-data` user.

But even without zmNinja, I run `curl -k http://localhost/zm/api/host/getVersion.json` with or without authentication, and it returns a 404 saying the `/zm/api` route is not found.
The apache2 config has not been messed with and is default as in the package.

Edit: I get

Code: Select all

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.58 (Ubuntu) Server at localhost Port 80</address>
</body></html>
How else can I debug ? i tried disabling authentication to see but same issue. Looks like the `/zm/api` route is returning errors.

Please advise.
User avatar
burger
Posts: 424
Joined: Mon May 11, 2020 4:32 pm

Re: Zoneminder 1.36.33 on Ubuntu 24.04.1 LTS with Php 8.3

Post by burger »

Sounds like viewtopic.php?p=135210

Post your apache config.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
stealthylabs
Posts: 2
Joined: Tue Oct 01, 2024 5:16 pm

Re: Zoneminder 1.36.33 on Ubuntu 24.04.1 LTS with Php 8.3

Post by stealthylabs »

That's amazing.

I was using the default zoneminder.conf which looked like below:

Code: Select all

# 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
</Directory>
I replaced the last 3 lines with the below from https://wiki.zoneminder.com/API#Example ... inder.conf and it started working:

Code: Select all

# For better visibility, the following directives have been migrated from the
# default .htaccess files included with the CakePHP project.
# Parameters not set here are inherited from the parent directive above.
<Directory "/usr/share/zoneminder/www/api">
   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>

<Directory "/usr/share/zoneminder/www/api/app/webroot">
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    RewriteBase /zm/api
</Directory>
Appreciate the help. Thank you.
Post Reply