Devuan 5 Daedalus with Zoneminder 1.36 from ZM Repo

From ZoneMinder Wiki
Jump to navigationJump to search

This install procedure was developed to use the Debian package developed by iconnor following Master.

The errors with Devuan vs. Debian are superfluous errors, due to init script generators using systemctl. Sysvinit users must manually run the db creation script, and procure an /etc/init.d/zoneminder script (for new installs).

To begin, install Devuan Ascii along with Apache2, PHP and a database (Mariadb recommended).

Add the repro

sudo nano /etc/apt/sources.list

Add the following line to the end of the file

deb https://zmrepo.zoneminder.com/debian/master buster/

CTRL+o then [Enter] to save

CTRL+x to exit

Install the following and retrieve the key from the repro

sudo apt install apt-transport-https gnupg
wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | sudo apt-key add -

Important - Make sure the above "wget" process completes without error! If it does not complete you will not get the most recent Zoneminder version this procedure is written for.

sudo apt update

Install mariadb-server, apache and php

sudo apt install mariadb-server apache2 php

Install Zoneminder

sudo apt install zoneminder

Sysvinit specific changes Configure user in mysql for ZM if this is a new install

cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf
echo 'grant lock tables,alter,create,select,insert,update,delete,index on zm.* to 'zmuser'@localhost identified by "zmpass";'    | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql

The reason this is done, is because the init script generator is using systemctl, and those without systemd don't have this command in the dpkg script at /var/lib/dpkg/info/zoneminder.postinst. So it must be run manually. An /etc/init.d/zoneminder script will also need to be grabbed from an earlier ZM install.

Users who have worked with ZM in the past may recognize these commands. In debian they are now automated, which can be good and bad (bad when it fails, and you don't know why).

End sysvinit section

If MySQL/MariaDB is not running during install run

sudo dpkg-reconfigure zoneminder

Enable Zoneminder

sudo systemctl enable zoneminder.service

Enable Apache Modules

sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo a2enmod cgi 

Add your timezone to PHP

Easy way

sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.3/apache2/php.ini

Long way

sudo nano /etc/php/7.3/apache2/php.ini

Search for [Date] (Ctrl + w then type Date and press Enter) and change date.timezone for your time zone. Don’t forget to remove the ; from in front of date.timezone.

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York

CTRL+o then [Enter] to save

CTRL+x to exit

Restart Apache and start Zoneminder

sudo service apache2 reload
sudo systemctl start zoneminder  
OR
sudo service zoneminder restart

You will also want to add the timezone to the Options page in the web console of ZM.