Difference between revisions of "Debian 11 Bullseye with Zoneminder 1.36.x"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 1: Line 1:
Updated 23AUG16 for Debian 8.5
Updated 11AUG21 for Debian 11


This easy install is for Debian 8 (Jessie) with Zoneminder 1.29.0 from the back ports install.
Debian 11 Bullseye is being released with Zoneminder 1.34.23 and as usual for Debian the zm database needs to be created manually. This is not user friendly so I have created this install to use the Zoneminder-Buster packages from the zmrepo. Yes this works as I have installed this on my production server!


I installed Debian from the netinst CD with only web server, SSH server and standard system utilities. Tasksel does not install LAMP under Debian so I installed MySQL and PHP after reboot.
Note: The following is for amd64 version of Bullseye. If there are packages in the zmrepo for other Buster architectures this should work by substituting the install packages for your architecture.  


Log in as your user
This assumes your user has sudo privilages. See: https://milq.github.io/enable-sudo-user-account-debian/


Then become root
1. Install Debian 11 (Bullseye), desktop or server version, along with Apache2, PHP and your favorite database (Mariadb recommended). A quick way to install LAMP this is:


  sudo root
  sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql


Install  PHP, and MySQL server. You will be prompted to set a MySQL password
2. Download zoneminder-doc_1.36.5-buster_all.deb and zoneminder_1.36.5-buster_amd64.deb (Yes, these are the files for Buster but read on)


  apt-get install  php5 mysql-server php-pear php5-mysql php5-gd
  wget https://zmrepo.zoneminder.com/debian/release-1.36/buster/zoneminder-doc_1.36.5-buster_all.deb


Note: you may want to set MySQL to use innodb_file_per_table. Here is a procedure for Ubuntu that should also work for Debian: https://wiki.zoneminder.com/Common_Issues_with_Zoneminder_Installation_on_Ubuntu#Enable_and_convert_MySQL_to_innodb_file_per_table_for_Zoneminder
  wget https://zmrepo.zoneminder.com/debian/release-1.36/buster/zoneminder_1.36.5-buster_amd64.deb


Add the Jessie backports
3. Then secure Mariadb:


  nano /etc/apt/sources.list
  sudo mysql_secure_installation


Add to the bottom of the list:
4. Install Gdebi:


  deb http://ftp.debian.org/debian jessie-backports main
  sudo apt install gdebi


Ctrl+o Enter to save
5. Install Zoneminder:
CTRL+x to exit


Update Sources
sudo gdebi zoneminder_1.36.5-buster_amd64.deb zoneminder-doc_1.35.5_all.deb


apt-get update
6. Additional steps:


Check to be sure everything is up to date
sudo systemctl enable zoneminder.service
sudo systemctl start zoneminder
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo service apache2 reload


apt-get upgrade
9. Open Zoneminder http://(IP-Address)/zm and remember to change the Timezone in Options-Timezone
 
apt-get dist-upgrade
 
Install Zoneminder
 
apt-get install zoneminder
 
or (if the above does not work)
 
apt-get -t jessie-backports 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)
 
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
 
nano /etc/php5/apache2/php.ini
 
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone
 
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
 
Ctrl+o Enter to save
 
CTRL+x to exit
 
27FEB16 A problem has been cited that requires the following to allow the API to work properly:
 
Change permissions in /usr/share/zoneminder/
 
chown -R www-data:www-data /usr/share/zoneminder/
 
Edit /etc/apache2/conf-enabled/zoneminder.conf
 
nano /etc/apache2/conf-enabled/zoneminder.conf
 
Add at the bottom:
 
<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
 
Ctrl+o Enter to save
 
CTRL+x to exit
 
Note that if you are using the API and If you alter the ZM mysql db password from the default then you must specify the new password. This file is located at
/usr/share/zoneminder/www/api/app/Config/database.php per [https://forums.zoneminder.com/viewtopic.php?f=32&t=23665 this post]
 
Restart Apache
 
service apache2 restart
 
Optional: Install Cambozola (needed if you use old versions of Internet Explorer)
Note: Cambozola requires Java Runtime Environement which many consider a security risk.
 
cd /usr/src && wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
 
tar -xzvf cambozola-latest.tar.gz
 
replace 936 with cambozola version downloaded
 
cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder
 
You should now be able to access the web server using http://servername
 
 
Open Zoneminder in web browser
 
http://serverip/zm
 
Optional:Click Options, check Is the (optional) cambozola java streaming client installed (?) Click Save
 
Your Zoneminder install is now ready to add cameras!
 
For a slight performance boost use 32 bit colour in camera settings.

Revision as of 19:24, 11 August 2021

Updated 11AUG21 for Debian 11

Debian 11 Bullseye is being released with Zoneminder 1.34.23 and as usual for Debian the zm database needs to be created manually. This is not user friendly so I have created this install to use the Zoneminder-Buster packages from the zmrepo. Yes this works as I have installed this on my production server!

Note: The following is for amd64 version of Bullseye. If there are packages in the zmrepo for other Buster architectures this should work by substituting the install packages for your architecture.

This assumes your user has sudo privilages. See: https://milq.github.io/enable-sudo-user-account-debian/

1. Install Debian 11 (Bullseye), desktop or server version, along with Apache2, PHP and your favorite database (Mariadb recommended). A quick way to install LAMP this is:

sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql

2. Download zoneminder-doc_1.36.5-buster_all.deb and zoneminder_1.36.5-buster_amd64.deb (Yes, these are the files for Buster but read on)

wget https://zmrepo.zoneminder.com/debian/release-1.36/buster/zoneminder-doc_1.36.5-buster_all.deb
wget https://zmrepo.zoneminder.com/debian/release-1.36/buster/zoneminder_1.36.5-buster_amd64.deb

3. Then secure Mariadb:

sudo mysql_secure_installation

4. Install Gdebi:

sudo apt install gdebi

5. Install Zoneminder:

sudo gdebi zoneminder_1.36.5-buster_amd64.deb zoneminder-doc_1.35.5_all.deb

6. Additional steps:

sudo systemctl enable zoneminder.service
sudo systemctl start zoneminder
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo service apache2 reload

9. Open Zoneminder http://(IP-Address)/zm and remember to change the Timezone in Options-Timezone