BSD Ports

multimedia/zoneminder 1.38.6 FreeBSD

Complete security camera solution, fully web based with image analysis

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
abb6f898c0
License
GPLv2
Categories
multimedia
Package size
11717.9 KiB, 79072.8 KiB installed

Description

Zoneminder is an all-in-one GPL'd security and surveillance camera solution. Fully web-based system for viewing and analyzing security camera feeds.

In the other systems

SystemPortVersion
FreeBSDmultimedia/zoneminder1.38.6
DragonFlymultimedia/zoneminder1.36.35

Install

Binary package:

pkg install zoneminder-php82

From the ports tree:

cd /usr/ports/multimedia/zoneminder/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	zoneminder-php82>0:multimedia/zoneminder

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest1.38.31.38.6-1.36.35_1-
FreeBSD:14:quarterly1.38.61.38.6n/a1.36.35_1-
FreeBSD:15:latest1.38.61.38.6n/a1.36.35_11.36.35_1
FreeBSD:15:quarterly1.38.61.38.6n/an/an/a
FreeBSD:16:latest1.38.31.38.6n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 3

Library 3

Runtime 6

The full lists below include those, and their dependencies in turn.

Build dependencies 149

The first 100 are listed.

Run dependencies 241

The first 100 are listed.

No port depends on this one.

Configuration

Options name: multimedia_zoneminder

OptionDefaultDescription
NLSoffNative Language Support
V4LoffVideo 4 Linux support
USES
cmake:insource,noninja cpe jpeg mysql perl5 php:flavors pkgconfig ssl sudo
Service scripts
zoneminder
Flavors
zoneminder-php83-1.38.6, zoneminder-php84-1.38.6, zoneminder-php85-1.38.6

Message after installing

ZoneMinder requires a MySQL (or MySQL forks) database backend and 
a http server, capable to execute PHP and CGI scripts.

To simplify things, we assume, that you use MySQL and NGINX on 
the same server.

1. Preliminary steps

1.1 Install databases/mysql57-server or newer
	You may choose your favourite method - ports or packages here. 

	ZoneMinder use very simple queries, however it tends to write to 
	the database quite a lot depending on your capture mode and number 
	of cameras. So tweak your MySQL instance accordantly

	Now, enable and start MySQL
		sysrc mysql_server_enable="YES"
		service mysql-server start

1.2 Install www/nginx 
	We provide an example for an HTTP install, however, you should use 
	HTTPS if you plan to expose your installation to the public. There 
	are plenty guides how to do it and security/letsencrypt.sh is a 
	good way to get a valid SSL certificate. Probably, your installation
	will be behind reverse proxy, so this example should work for you.

	Please, notive the following issues with ZM:

	- web interface has several hardcoded /zm in url generation, so it is
		mandatory to serve your installtion from /zm subfolder
	- if behind reverse proxy, HTTP_X_FORWARDED_PROTO must be supplied or link
		generation will use http://

	Your server block should include the following:

	server {
		listen 80;

		root /usr/local/www/zoneminder;
		index index.php
		gzip off;

		location /cgi-bin/nph-zms {

			include fastcgi_params;
			fastcgi_param SCRIPT_FILENAME $request_filename;
			fastcgi_pass  unix:/var/run/fcgiwrap/fcgiwrap.sock;
		}

		location /zm/cache {

			alias /var/cache/zoneminder;
		}

		location /zm {

			alias	/usr/local/www/zoneminder;

			location ~ \.php$ {

				if (!-f $request_filename) { return 404; }
				include fastcgi_params;
				fastcgi_param SCRIPT_FILENAME $request_filename;
				fastcgi_index index.php;
				fastcgi_pass unix:/var/run/php-fpm.sock;
			}

			location ~ \.(jpg|jpeg|gif|png|ico)$ {
				access_log	off;
				expires	33d;
			}

			location /zm/api/ {
				alias	/usr/local/www/zoneminder;
				rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;
			}
		}
	}

	Enable and start NGINX
		sysrc nginx_enable="YES"
		service nginx start

1.3 Install www/fcgiwrap 
	As NGINX lacks it's own CGI wrapper, we need external one. Please 
	note that ZoneMinder's montage page use simultaneous access to all 
	cameras, so you need to use at least as many fcgiwrap workers as 
	your number of cameras. The following example assumes you have 4.

	Enable and start FcgiWrap
		sysrc fcgiwrap_enable="YES"
		sysrc fcgiwrap_user="www"
		sysrc fcgiwrap_socket_owner="www"
		sysrc fcgiwrap_flags="-c 4"

1.4 PHP is installed as a dependency to ZoneMinder. However, you should 
	tweak some of it's settings.
	Edit /usr/local/etc/php-fpm.conf and set

		listen = /var/run/php-fpm.sock
		listen.owner = www
		listen.group = www
		env[PATH] = /usr/local/bin:/usr/bin:/bin

	If you want to set another path for the socket file, make sure you 
	change it in your NGINX config well. The env[PATH] needs to be set 
	to locate the zip utility as ZoneMinder's export functions rely on 
	exec(). Sorry, chroot folks. 

	PHP throws warning if date.timezone option is not set. The best place 
	to do it is to create new ini file in /usr/local/etc/php with overrides

		date.timezone = "UTC"

	Enable and start php-fpm
		sysrc php_fpm_enable="YES"
		service php-fpm start

1.5 ZoneMinder keeps the last 1-3 frames from monitors as cache when broadcasting 
        stream through zms. This can be a performance hog if 
	placed on spindle drive or add wear to SSD. The best practice is put it on 
	tmpfs. 	See https://www.freebsd.org/cgi/man.cgi?query=tmpfs for more 
	information.

	ZoneMinder will use /tmp for default. If you plan to change it, see 
	ZM_PATH_MAP setting.

	Edit /etc/fstab and add the following:

		tmpfs			/tmp		tmpfs	rw,nosuid,mode=01777	0	0

2. ZoneMinder installation

	Connect to MySQL under root and create zm user and populate database.

	mysql -u root -p
	
		CREATE DATABASE zm;
		GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
		FLUSH PRIVILEGES;
		quit;
	
	mysql -u root -p zm < /usr/local/share/zoneminder/db/zm_create.sql
	
2.1 If you have chosen to change the ZoneMinder MySQL credentials to something
	other than zmuser/zmpass then you must now edit /usr/local/etc/zm.conf. Change
	ZM_DB_USER and ZM_DB_PASS to the values you created in the previous step.

	Enable and start ZoneMinder
		sysrc zoneminder_enable="YES"
		service zoneminder start

To perform an upgrade from any version:
 
1. Stop ZoneMinder
	service zoneminder stop

2. Upgrade database
	sudo -u www zmupdate.pl
	
3. Start ZoneMinder
	service zoneminder start

If you see error ERROR 1419 (HY000) during database update, set 
log_bin_trust_function_creators = 1 in runtime or in mysql server config;

For example, login as root and issue SET GLOBAL log_bin_trust_function_creators = 1;

If ZM interface complains about absent configuration parameters, zmupdate.pl script
contains --freshen option to add them.

You can execute it with sudo -u www zmupdate.pl --freshen

Starting from version 1.36, ZM doesn't need too much tmpfs space. zmc process now
allocates memory as needed. tmpfs backed /tmp is still needed by zms to store 
1-3 images, so you shrink your tmpfs /tmp drasticallyi (if you followed installation
guide).

Files

Manual pages 20
  • zmaudit.pl(8)
  • zmc(8)
  • zmcamtool.pl(8)
  • zmcontrol.pl(8)
  • zmdc.pl(8)
  • zmeventtool.pl(8)
  • zmfilter.pl(8)
  • zmonvif-probe.pl(8)
  • zmonvif-trigger.pl(8)
  • zmpkg.pl(8)
  • zmrecover.pl(8)
  • zmstats.pl(8)
  • zmtelemetry.pl(8)
  • zmtrack.pl(8)
  • zmtrigger.pl(8)
  • zmu(8)
  • zmupdate.pl(8)
  • zmvideo.pl(8)
  • zmwatch.pl(8)
  • zmx10.pl(8)
pkg-plist 8737
  • bin/zm_rtsp_server
  • bin/zmaudit.pl
  • bin/zmc
  • bin/zmcamtool.pl
  • bin/zmcontrol.pl
  • bin/zmdc.pl
  • bin/zmeventtool.pl
  • bin/zmfilter.pl
  • bin/zmonvif-probe.pl
  • bin/zmonvif-trigger.pl
  • bin/zmpkg.pl
  • bin/zmrecover.pl
  • bin/zmstats.pl
  • bin/zmtelemetry.pl
  • bin/zmtrack.pl
  • bin/zmtrigger.pl
  • bin/zmu
  • bin/zmupdate.pl
  • bin/zmvideo.pl
  • bin/zmwatch.pl
  • bin/zmx10.pl
  • etc/zm.conf
  • etc/zoneminder-php82/01-system-paths.conf
  • etc/zoneminder-php82/02-multiserver.conf
  • etc/zoneminder-php82/README
  • %%SITE_PERL%%/ONVIF/Analytics/Attributes/actor.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Attributes/contentType.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Attributes/encodingStyle.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Attributes/expectedContentTypes.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Attributes/mustUnderstand.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/AudioDecoderConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/AudioEncoderConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/AudioOutputConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/AudioSourceConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Body.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Capabilities.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/CreateAnalyticsModules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/CreateAnalyticsModulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/CreateRules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/CreateRulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/DeleteAnalyticsModules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/DeleteAnalyticsModulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/DeleteRules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/DeleteRulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Envelope.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Fault.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetAnalyticsModules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetAnalyticsModulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetRules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetRulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetServiceCapabilities.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetServiceCapabilitiesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetSupportedAnalyticsModules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetSupportedAnalyticsModulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetSupportedRules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/GetSupportedRulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Header.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Include.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Message.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/MetadataConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/MetadataStream.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/ModifyAnalyticsModules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/ModifyAnalyticsModulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/ModifyRules.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/ModifyRulesResponse.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/PTZConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Polygon.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/Polyline.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/VideoAnalyticsConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/VideoEncoderConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Elements/VideoSourceConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Interfaces/Analytics/AnalyticsEnginePort.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Interfaces/Analytics/RuleEnginePort.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Typemaps/Analytics.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AACDecOptions.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AbsoluteFocus.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AbsoluteFocusOptions.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/ActionEngineEventPayload.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/ActionEngineEventPayloadExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsCapabilities.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsDeviceCapabilities.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsDeviceEngineConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsDeviceEngineConfigurationExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsDeviceExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngine.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineConfiguration.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineConfigurationExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineControl.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineInput.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineInputInfo.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsEngineInputInfoExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsState.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnalyticsStateInformation.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AnyHolder.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/Appearance.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AppearanceExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AttachmentData.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AudioAnalyticsStream.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AudioAnalyticsStreamExtension.pm
  • %%SITE_PERL%%/ONVIF/Analytics/Types/AudioAttributes.pm

The first 100 are listed.

distinfo 5
FileSizeSHA256
zoneminder-zoneminder-1.38.6_GH0.tar.gz2.065855e+071e536ce736d030cd415bbb7a09d39d58d8d7f6064bf87e5e14015b37bd3bec59
FriendsOfCake-crud-1429237_GH0.tar.gz730184dc57f344623d3c0e735b53ed583e5382aa9e43012215f641cbd8ebad381aadc
ZoneMinder-CakePHP-Enum-Behavior-ea90c0c_GH0.tar.gz35003a9006c7c59f2b864ce628df4725b241fc23cfd9abc56e746acbd22d850f5ab1
chmike-CxxUrl-eaf46c0_GH0.tar.gz14291975c1463c3a5d44c1dd911094f58b9490f46c0cc78683418dcd9dbb78c34e35a
ZoneMinder-RtspServer-a071599_GH0.tar.gz1.400029e+06f834708f475474e7e2ab2de34c81b169f1580866bbef58395c68d99319111c08

Commit history 3

DateCommitCreditsLog message
abb6f898c0 Vladimir Druzenko multimedia/zoneminder: Update 1.38.3 => 1.38.6
Changelogs: https://github.com/ZoneMinder/zoneminder/releases/tag/1.38.4 https://github.com/ZoneMinder/zoneminder/releases/tag/1.38.5 https://github.com/ZoneMinder/zoneminder/releases/tag/1.38.6 - Requires "zmupdate.pl -f" for upgrade. PR: 299164 Approved by: Ivan <[email protected]> (maintainer) Security: GHSA-vvx7-ghpv-jq98 Security: GHSA-rpp4-xmqm-84ff Security: GHSA-xp4c-29hh-2w4j Security: GHSA-pfph-4j9j-7cv7 Security: GHSA-pxq8-5c8j-xf3r Security: GHSA-p8h3-4x5c-cv7p Security: GHSA-wmcc-x64g-jr84 Security: GHSA-m77q-66v7-j3fq Security: GHSA-72rf-54rm-798c Security: GHSA-vvw3-j4p4-4rgx Security: GHSA-34x2-mw89-c52f Security: GHSA-993c-fc6p-hpxg Security: GHSA-f8h6-62c9-x6qr Security: GHSA-4r2m-68p2-phf7 Security: GHSA-m896-3fc6-2jf5 Security: GHSA-r44j-mvj8-cg9w …
2f1af67af4 Ivan multimedia/zoneminder: Update 1.38.1 => 1.38.3
Changelog: https://github.com/ZoneMinder/zoneminder/releases/tag/1.38.3 - Fix ONVIF support with add devel/gsoap to BUILD_DEPENDS. PR: 296995 Security: GHSA-g66m-77fq-79v9 Security: GHSA-745h-vg7c-73cg Sponsored by: UNIS Labs Co-authored-by: Vladimir Druzenko <[email protected]> MFH: 2026Q3
63b6120db0 Muhammad Moinur Rahman */*php86*: Sunrise
Please DO NOT use this version in production, it is an early test version. For upgrade notes please visit: https://github.com/php/php-src/blob/php-8.6.0alpha1/UPGRADING Changelog: https://github.com/php/php-src/blob/php-8.6.0alpha1/NEWS