Difference between revisions of "Debian 10 Buster with Zoneminder 1.36.x from ZM Repo"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 1: Line 1:
'''Note: This procedure is obsolete with the release of Zoneminder 1.29.0 in February 2016. Zoneminder 1.28.1 is no longer in the backports.'''
== Debian 10 Buster with Zoneminder 1.32.3 from the Debian Multimedia Repository ==




This easy install is for Debian 8.1 and 8.2 on Amd64 architecture (Jessie) with Zoneminder 1.28.1 from the back ports install. Please note that this documentation is also correct for Debian 8.1 release.
Install Debian Buster. I used the net install CD and installed only web server, SSH server and standard system utilities from tasksel.


A special THANKS to "felixr" for filling in where I did not know what to do!
Login and become root. I have added sudo and permissions for my user and have omitted the use of sudo before each command.


I installed Debian from the netinst CD with only web server, SSH server and standard system utilities. Tasksel does not
sudo su
install LAMP under Debian so I installed MySQL and PHP after reboot.


Note: I log in using Putty on my Windows PC as I can then copy and paste commands from this instruction. I also
Install additional LAMP components
install Webmin to manage the server from a web browser.  http://www.webmin.com/deb.html


Log in as root.  
apt install php mariadb-server php-mysql libapache2-mod-php7.3


su root  (followed by your root password)
Secure Mariadb, create root password et. al.


Install PHP, and MySQL server (This installs MySQL server 5.5. If you want to use MySQL 5.6 follow the instructions [[Install MySQL 5.6 on Debian Jessie]] (using mariadb also works fine, as tested on Debian 8.2, replacement package for mysql-server is then mariadb-server)
  mysql_secure_installation


apt-get install  php5 mysql-server php-pear php5-mysql


Add the Jessie backports to your standard repo
Install Zoneminder
 
Add the Deb Multimedia repository. (instructions at: https://deb-multimedia.org/)
 
Edit sources.list


  nano /etc/apt/sources.list
  nano /etc/apt/sources.list


add to the bottom of the list:
Add to the end of the file:


  deb http://http.debian.net/debian jessie-backports main
  deb http://www.deb-multimedia.org buster main non-free


Ctrl+o Enter to save
Ctrl+o Enter to save
CTRL+x to exit
Update Sources
apt-get update
Check to be sure everything is up to date


apt-get upgrade
Ctrl+x to exit
apt-get dist-upgrade


Optional: Set static IP address
After you have added the necessary line in /etc/apt/sources.list the first package to install is deb-multimedia-keyring.


  nano /etc/network/interfaces
  wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb


Make changes similar to this:
dpkg -i deb-multimedia-keyring_2016.8.1_all.deb


  auto eth0
  apt update
iface eth0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 192.168.1.1
 
Reboot server if needed


Install Zoneminder
Install Zoneminder


  apt-get install zoneminder
  apt install zoneminder vlc-plugin-base


You may need to install "extra" VLC components (I will check this and edit as needed)
apt-get install libvlc-dev libvlccore-dev vlc


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


This next step creates a file which contained the MySQL user and password. Otherwise you will have to enter the user and password on the command line which is not secure!
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql


Go to the root directory
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
cd ~


Create a hidden password file
mysqladmin -uroot -p reload


nano .my.cnf
Set permissions


Enter this content (but use your MySQL root password!)
chmod 740 /etc/zm/zm.conf


  [client]
  chown root:www-data /etc/zm/zm.conf
user=root
password=(mysqlpass)
 
Ctrl+o Enter to save
 
CTRL+x to exit
 
Create database (press ENTER after each command)
 
mysql < /usr/share/zoneminder/db/zm_create.sql


  mysql -e "grant select,insert,update,delete,create on zm.* to 'zmuser'@localhost identified by 'zmpass';"
  chown -R www-data:www-data /usr/share/zoneminder/


Remove password file
  chown -R www-data:www-data /var/cache/zoneminder/
 
  rm .my.cnf
 
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
Enable Zoneminder service to start at boot
Line 119: Line 81:


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


Restart Apache
a2enmod rewrite


  service apache2 restart
  a2enconf zoneminder


*** You may be tempted to try Zoneminder at this point but there is one setting you will need to change from the web gui.  Read on!!!
Add timezone to PHP


Optional: Install Cambozola (needed if you use Internet Explorer)
nano /etc/php/7.3/apache2/php.ini


cd /usr/src && wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone


tar -xzvf cambozola-latest.tar.gz
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York


replace 936 with cambozola version downloaded
Ctrl+o Enter to save


cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder
CTRL+x to exit


You should now be able to access the web server using http://servername
Restart Apache


service apache2 restart


Open Zoneminder in web browser
All done! Navigate to http://serverip/zm
 
http://serverip/zm
 
Click Options
 
Uncheck: Check with zoneminder.com for updated versions (?) click Save
 
Click Images tab
 
Check Is the (optional) cambozola java streaming client installed (?) Click Save
 
Click Paths
 
Change PATH_ZMS from /cgi-bin/nph-zms to /zm/cgi-bin/nph-zms      Click Save
 
Optional: under Paths change PATH_SWAP to /dev/shm (puts this process in RAM drive)  Click Save
 
Restart Zoneminder
 
Your Zoneminder install is now ready to add cameras!

Revision as of 13:10, 8 July 2019

Debian 10 Buster with Zoneminder 1.32.3 from the Debian Multimedia Repository

Install Debian Buster. I used the net install CD and installed only web server, SSH server and standard system utilities from tasksel.

Login and become root. I have added sudo and permissions for my user and have omitted the use of sudo before each command.

sudo su

Install additional LAMP components

apt install php mariadb-server php-mysql libapache2-mod-php7.3

Secure Mariadb, create root password et. al.

mysql_secure_installation


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 buster 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.

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
apt update

Install Zoneminder

apt install zoneminder vlc-plugin-base 


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

chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/
chown -R www-data:www-data /var/cache/zoneminder/

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/php/7.3/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

Restart Apache

service apache2 restart

All done! Navigate to http://serverip/zm