HOWTO: Installing ZoneMinder in a FreeNAS 11 Jail

mvcad

Contributor
Joined
Feb 25, 2018
Messages
116

mvcad

Contributor
Joined
Feb 25, 2018
Messages
116

kmb5405

Cadet
Joined
Jan 13, 2019
Messages
6
httpd-error.log showing: PHP Fatal error: Uncaught Error: Class 'PDO' not found in /usr/local/www/zoneminder/includes/database.ph$

EDIT: Fixed it by starting over and using mod_php72 and php72-mysqli. All works now!
 
Last edited:

bermau

Dabbler
Joined
Jul 4, 2017
Messages
28
So you know, now you can install zoneminder from Freenas GUI under Plugins -> Available Plugins. just need to run the wizard and it will do it all for you. I just did it myself and it worked straight away.

Hi, do you have API working with Zoneminder Freenas Plugin?
I receive cakephp fatal error, navigate to http://myip/zm/api

Cattura.jpg

Any suggestions for me?
 

Peltsu

Cadet
Joined
Mar 27, 2017
Messages
4
Hi, do you have API working with Zoneminder Freenas Plugin?
I receive cakephp fatal error, navigate to http://myip/zm/api

View attachment 28176

Any suggestions for me?

If you read all errors more closely, you may notice that it is trying to write a log file to /var/log/zm/

Make sure that the folder exists with correct permissions.
 

Clinderw

Explorer
Joined
Aug 11, 2013
Messages
96
The less that's stored inside the jail, the easier it is to rebuild the jail if necessary. If you look at some of the recent how-to documents for iocage jails (e.g., https://forums.freenas.org/index.ph...unifi-controller-with-lets-encrypt-iocage.81/ or https://forums.freenas.org/index.php?resources/fn11-jailed-crashplan-pro-with-vnc-iocage.79/), they're even putting the config files outside of the jail, so that the only thing stored in the jail itself is the actual software. That means you can destroy the jail and rebuild it with the latest software, even upgrading the underlying OS template, without disturbing your data or configuration.

There's also the fact that some users (like me) put jails on a separate, smaller (sometimes SSD) pool, and wouldn't want the large amount of data taking space on the smaller pool.

How do you change where the config details are saved so I can blow the jail away as often as needed? With all my other jails, I mount a dataset in the jail at '/config' and have it save there. I've tried both of the below two commands (which has worked for other jails/plugins). I also have some that require rc files to do this but don't think zoneminder needs that.

iocage exec zoneminder sysrc zoneminder_conf_dir="/config"
iocage exec zoneminder sysrc zoneminder_data_dir="/config"

Can anyone point me in the right direction - lot of Googling hasn't turned up much yet.

If I'm reading correctly, the changing of the storage is easier because it can be managed within the GUI of zoneminder - any other spots need affected for that?

Chris
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,457
How do you change where the config details are saved so I can blow the jail away as often as needed?
I really don't have any idea. If it's supported, there should be a variable in the rc script. Look at /usr/local/etc/rc.d/zoneminder in the jail; the top of that file should document the relevant variables.
 

twsps

Contributor
Joined
Jul 10, 2018
Messages
113
Hi, I finished the guide on 11.1 U6 however I cannot add any cameras (nothing happens when I press add button) and I think my javascript isn't loaded correctly. Any ideas?
 

Attachments

  • Screen Shot 2019-06-20 at 7.14.49 PM.png
    Screen Shot 2019-06-20 at 7.14.49 PM.png
    194.4 KB · Views: 658

tuplink

Cadet
Joined
Nov 24, 2017
Messages
1
Hi, I finished the guide on 11.1 U6 however I cannot add any cameras (nothing happens when I press add button) and I think my javascript isn't loaded correctly. Any ideas?

i ran into this issue too along with a bunch of others. if you look at the source of the page you will see that the css uri is server.tld/zm/xxx.css

HTTPD.CONF (the first redirect was the cause of most of the issues as the source has some references to full path resources like server.tld/zm/xxxxx, however after going through this tutorial that path dosn't exist, its in the root of the uri)
<VirtualHost *:80>
ServerName whippet.domain.tld
ServerAdmin email@example.com
DocumentRoot "/usr/local/www/zoneminder/"
ScriptAlias /cgi-bin/ /usr/local/www/zoneminder/cgi-bin/
<Directory "/usr/local/www/zoneminder">
Options FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
RedirectMatch "^/zm/(.*)" "/$1"
</Directory>
<Directory "/usr/local/www/zoneminder/cgi-bin/">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
#AddHandler test-cgi .cgi .pl .py nph-zms zms
AllowOverride All
Require all granted
</Directory>
<Directory "/usr/local/www/apache24/cgi-bin/">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>
<Directory "/usr/local/www/zoneminder/api">
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /api
</Directory>

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

<Directory "/usr/local/www/zoneminder/api/app/webroot">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteBase /api
</Directory>

LogLevel debug
</VirtualHost>
 

trommegutten

Cadet
Joined
Mar 29, 2020
Messages
8
I just wanted to let others know that I've installed the official Zoneminder plugin successfully today. I'm on FreeNAS11.3-U1. The plugin installed Zoneminder version 1.34.9.

The timezone was set to UTC and the montage review slider was not showing the correct time scale, so I had to change the timezone. (I also installed nano editor to edit the file).
Code:
root@zoneminder:~ # pkg install nano
root@zoneminder:~ # nano /usr/local/etc/php.ini

Find and change date.timezone. I changed my line to
Code:
 date.timezone = "Europe/Oslo"

I also mounted my camera folder to the jail (in FreeNAS web ui) /var/tank1cam/events and then (in the jail shell) added group privileges to the www user, see code (you'll find the groupid in FreeNAS web ui - groups)
Code:
root@zoneminder:~ # pw groupadd -n mygroupname -g groupid
root@zoneminder:~ # pw groupmod mygroupname -m www
 
Top