Requirements:
- MariaDB
- Apache2
Installing packages
# apt-get install zoneminder apache2 mariadb-server-10.5 mariadb-client-10.5 php php7.4 libapache2-mod-php7.4 php7.4-mysql
# chown www-data:www-data /usr/share/zoneminder/ -R
# chown root:www-data /etc/zm/ -R
# a2enmod cgi
# a2enmod rewrite
# a2enconf zoneminder
Set root password (optional). For the first time after installation, password for mariadb root is blank.
# mysqladmin -u root -p password yournewpass
Create DB, User and Password. Omit option -p for mariadb root if you do not set password.
# mysql –u root –p
MariaDB [(none)]> CREATE USER 'zmuser' IDENTIFIED BY 'zmpass';
MariaDB [(none)]> CREATE DATABASE zm;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost';
Creating DB
# mysql -u zmuser -p < /usr/share/zoneminder/db/zm_create.sql
NOTE: if change user, password or database, you need to change file in /etc/zm/zm.conf
# ZoneMinder database name
ZM_DB_NAME=zm
# ZoneMinder database user
ZM_DB_USER=zmuser
# ZoneMinder database password
ZM_DB_PASS=zmpass
Restarting services
# systemctl restart apache2
# systemctl restart zoneminder
From browser open URL http://localhost/zm
References:
- https://forums.zoneminder.com/viewtopic.php?t=29355
- https://wiki.zoneminder.com/Debian_11_Bullseye_with_Zoneminder_1.36.x