Difference between revisions of "Debian 12 Bookworm with Zoneminder 1.36.x and 1.37.x"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 1: Line 1:
__TOC__
Debian 12 Bookworm is being released with Zoneminder 1.36.33 and as usual for Debian the zm database needs to be created manually.


===Debian 9 with Zoneminder 1.30.4===
In Bookwork sudo is installed but you will have to add the user to the sudoers file.  
17FEB19 This procedure can be used to install Zoneminder on a Raspberry Pi. I used a Pi3 B+.
Become root with


08OCT17 - This procedure has been verified with the Debian 9.2.0.  
  sudo su
 
Note: 23JUN17 - I was able to get the libvlc source to work! I have added the install for vlc-plugin-base which allows the Zoneminder install to complete without errors. However, I have been getting some console errors from VLC. It may be my old camera and you may have good results with libvlc but I consider ffmpeg better to use.
 
I used Debian 9 net install CD (https://www.debian.org/CD/netinst/).
 
Install only: web server, SSH server and standard system utilities from tasksel


Login and become root (su root) or prepend sudo to the following commands
Then add the user


If needed check to make sure you are up to date
/sbin/adduser username sudo


apt update
I recommend rebooting at this point
apt upgrade
apt dist-upgrade
 
===Install additional LAMP components Mariadb server (recommended)===
 
apt install php mariadb-server php-mysql libapache2-mod-php7.0
 
Secure Mariadb, create root password et. al.
 
mysql_secure_installation
 
NOTE:The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link (this also works for MySQL 5.6).
 
rm /etc/mysql/my.cnf 
 
cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf
 
'''The following change to Mariadb settings is optional but is included if you have problems logging into Zoneminder'''
 
nano /etc/mysql/my.cnf
 
Make the following changes:
 
character-set-server = latin1
collation-server = latin1_swedish_ci
 
Note: The above settings are actually the Mariadb default. Changing back to default is necessary to avoid errors when logging into Zoneminder. This was added on 01APR17 but is not an April Fool! It may be necessary to align these settings with your regional language.
 
Ctrl+o Enter to save
 
Ctrl+x to exit
 
Restart Mariadb
 
service mariadb restart
 
===Install Zoneminder===
 
Add the Deb Multimedia repository. (instructions at: https://deb-multimedia.org/)
 
Edit sources.list
 
nano /etc/apt/sources.list
 
Add to the end of the file:
 
deb http://www.deb-multimedia.org stretch main non-free
 
Ctrl+o Enter to save
 
Ctrl+x to exit
 
After you have added the necessary line in /etc/apt/sources.list the first package to install is deb-multimedia-keyring.
 
apt update
apt install deb-multimedia-keyring
 
If apt-get can not find the new key, do that :
 
wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
 
Update packages list:
 
apt update
apt upgrade
apt dist-upgrade
 
 
Install Zoneminder
 
apt install zoneminder vlc-plugin-base php7.0-gd
 
 
Set permissions of /etc/zm/zm.conf to root:www-data 740
 
chmod 740 /etc/zm/zm.conf
 
chown root:www-data /etc/zm/zm.conf
 
Enable Zoneminder service to start at boot
 
systemctl enable zoneminder.service
 
Add www-data to the sudo group (to enable use of local video devices)
 
adduser www-data video
 
 
Start Zoneminder
 
systemctl start zoneminder.service
 
Check to see that Zoneminder is running
 
systemctl status zoneminder.service
 
Enable CGI and Zoneminder configuration in Apache.
 
a2enmod cgi
 
a2enmod rewrite
 
a2enconf zoneminder
 
Add timezone to PHP
 
sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.0/apache2/php.ini
 
Change permissions in /usr/share/zoneminder/
 
chown -R www-data:www-data /usr/share/zoneminder/
 
 
Restart Apache
 
service apache2 restart
 
Open Zoneminder in a web browser (http://server-ip/zm).
 
10OCT17 - An issue with the /tmp/zm directory has been reported. Debian uses private tmp folders so even though you can see the files & folders, zoneminder cannot because it is running under a different user account.
 
Go to Options -> Paths and then inspect each PATH_XXX variable. If it is set to "/tmp/zm", change it to "/dev/shm". Don't forget to restart zoneminder.
 
===Alternate install MySQL Server===
Note: Install of MySQL was not tested with the Debian 9.0.0 release but should work based on past experience
 
apt install php default-mysql-server php-mysql apache2-mod-php7.0
 
Make a change to MySQL settings: (Note: Your my.cnf may be in another location)
 
nano /etc/mysql/my.cnf
 
In the [mysqld] section add the following
 
sql_mode = NO_ENGINE_SUBSTITUTION
 
Note: if you are installing on an existing database server you can use the following as an alternate to 'sql_mode = NO_ENGINE_SUBSTITUTION' (Thanks to "bodom" for this alternate):
 
init_connect = 'SET @@sql_mode = CASE CURRENT_USER() WHEN \'zmuser@localhost\' THEN \'NO_ENGINE_SUBSTITUTION\' ELSE @@sql_mode END;'
 
Ctrl+o Enter to save
 
Ctrl+x to exit
 
Restart MySQL
 
systemctl restart mysql
 
Continue with Zoneminder install https://wiki.zoneminder.com/Debian_9_64-bit_with_Zoneminder_1.30.4_the_Easy_Way#Install_Zoneminder
 
===Raspberry Pi 3B Zoneminder 1.30.4===


Become root
Become root
Line 175: Line 16:
  sudo su
  sudo su


Install additional LAMP components Mariadb server (recommended)
Install Apache2, PHP and your favorite database (Mariadb recommended). A quick way to install LAMP is:


  apt install php mariadb-server php-mysql libapache2-mod-php7.0 apache2
  sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql lsb-release gnupg2


Secure Mariadb, create root password et. al.
Secure MySQL or Mariadb, create root password et. al.


  mysql_secure_installation
  mysql_secure_installation
Edit sources.list
nano /etc/apt/sources.list
For Pi uncomment:
deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free$
Ctrl+o Enter to save
Ctrl+x to exit
Update apt
apt update


Install Zoneminder
Install Zoneminder
Line 203: Line 28:
  apt install zoneminder
  apt install zoneminder


Set permissions of /etc/zm/zm.conf to root:www-data 740


chmod 740 /etc/zm/zm.conf
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)
 
chown root:www-data /etc/zm/zm.conf
 
Enable Zoneminder service to start at boot
 
systemctl enable zoneminder.service
 
Add www-data to the sudo group (to enable use of local video devices)
 
adduser www-data video
 
For Pi, Create Zoneminder database in Mariadb (Note: this also creates the default Zoneminder user and permissions in MySQL)


  mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
  mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
Line 224: Line 36:


  mysqladmin -uroot -p reload
  mysqladmin -uroot -p reload
Start Zoneminder
systemctl start zoneminder.service
Check to see that Zoneminder is running
systemctl status zoneminder.service
Enable CGI and Zoneminder configuration in Apache.
a2enmod cgi
a2enmod rewrite
a2enconf zoneminder
Add timezone to PHP
sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.0/apache2/php.ini
Change permissions in /usr/share/zoneminder/
chown -R www-data:www-data /usr/share/zoneminder/
Restart Apache
service apache2 restart
===Debian 9 with Zoneminder 1.32.2 from the Experimental Repro===
This is an interim install procedure for the bold user! Start with a fresh Debian 9 install.
Note: this will do updates from the sid repro as well!
'''Warning:''' Release 1.32.3-2 from Debian Unstable package as of 4/2019 is not compiled with H264 support, so the functions of H264 encode and passthrough will not function. However, it is still possible to use traditional MJPEG frame and analysis saving. It may be advised to try the [[Debian_9_64-bit_with_Zoneminder_1.32.3_the_Easy_Way]] ZMRepo link. Users can also apt-source the package and recompile with the necessary dependencies. Also be aware that purge when full filter has had some changes (see link)[https://forums.zoneminder.com/viewtopic.php?f=38&t=28190&p=110091&hilit=purge+when+full#p110211]
Edit sources.list
nano /etc/apt/sources.list
Add to the end of the file:
deb http://deb.debian.org/debian experimental main
deb http://deb.debian.org/debian sid main
To install an experimental package, do:
apt update
apt upgrade    (note: this will do all the updates in sid  unstable!)
apt install libnumber-bytes-human-perl (needed for zmfilter.pl to run)
apt -t experimental install zoneminder


Set permissions of /etc/zm/zm.conf to root:www-data 740
Set permissions of /etc/zm/zm.conf to root:www-data 740
Line 294: Line 49:
Add www-data to the sudo group (to enable use of local video devices)
Add www-data to the sudo group (to enable use of local video devices)


adduser www-data video
a dduser www-data video
 
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)
 
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
 
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
 
mysqladmin -uroot -p reload


Start Zoneminder
Start Zoneminder
Line 308: Line 55:
  systemctl start zoneminder.service
  systemctl start zoneminder.service


Enable CGI and Zoneminder configuration in Apache.
Enable Zoneminder configuration in Apache.
 
a2enmod cgi


a2enconf zoneminder
  a2enmod rewrite
  a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload


a2enconf zoneminder
Install complete. Open Zoneminder/Options and set the timezone
 
Add timezone to PHP
 
sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.0/apache2/php.ini
 
Change permissions in /usr/share/zoneminder/
 
chown -R www-data:www-data /usr/share/zoneminder/
 
Restart Apache
 
service apache2 restart

Revision as of 10:09, 6 June 2023

Debian 12 Bookworm is being released with Zoneminder 1.36.33 and as usual for Debian the zm database needs to be created manually.

In Bookwork sudo is installed but you will have to add the user to the sudoers file. Become root with

sudo su

Then add the user

/sbin/adduser username sudo 

I recommend rebooting at this point

Become root

sudo su

Install Apache2, PHP and your favorite database (Mariadb recommended). A quick way to install LAMP is:

sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql lsb-release gnupg2

Secure MySQL or Mariadb, create root password et. al.

mysql_secure_installation

Install Zoneminder

apt install zoneminder


Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload

Set permissions of /etc/zm/zm.conf to root:www-data 740

chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf

Enable Zoneminder service to start at boot

systemctl enable zoneminder.service

Add www-data to the sudo group (to enable use of local video devices)

a dduser www-data video

Start Zoneminder

systemctl start zoneminder.service

Enable Zoneminder configuration in Apache.

a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload

Install complete. Open Zoneminder/Options and set the timezone