Difference between revisions of "Ubuntu Server 19.10 Zoneminder 1.33.x"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 76: Line 76:


  sudo checkinstall
  sudo checkinstall
Follow the instructions on the screen. Enter anything for the description (e.g. Libraries for Zoneminder MP4 support). On the table of values: change the entries as following: Name='''''libmp4v2-2''''', Version='''''2.0''''', Provides='''''libmp4v2-2'''''
Follow the instructions on the screen. Enter anything for the description (e.g. Libraries for Zoneminder MP4 support). On the table of values: change the entries as following:  
 
* Name='''''libmp4v2-2'''''
 
* Version='''''2.0'''''  
 
* Provides='''''libmp4v2-2'''''


== Repacking zoneminder deb-package and installation ==
== Repacking zoneminder deb-package and installation ==

Revision as of 10:37, 8 May 2019

<Home

Zoneminder 1.32 made it into the "official" Ubuntu 19.04 repositories. Unfortunately the MP4 recording and playback does not work with the shipped version as there are missing libraries (libmp4v2-2). So events can only be saved in jpeg-frames, video recordings do not happen. [State: 01 MAY 2019]


These instructions will show how to install Zoneminder 1.32-3 from the iconnor ppa with mp4 support to use video recordings.

N.B.: The version from iconnor ppa has an issue with the required dependencies for libx264 on Ubuntu 19.04, we have to correct this by manually repacking the deb-package.


You will need to install LAMP then secure MySQL before installing Zoneminder. see: https://help.ubuntu.com/community/ApacheMySQLPHP

Preparations

Install needed packages:

sudo apt-get install x264 x265 build-essential checkinstall gdebi


Secure MySQL or Mariadb:

mysql_secure_installation


Add entry into my.cnf:

nano /etc/mysql/my.cnf


Add the following to the end of the file:

[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION

CTRL + o CTRL + x

Restart MySQL:

service mysql restart


Install the official repository for the current stable version 1.32:

sudo add-apt-repository ppa:iconnor/zoneminder-1.32

Now installing zoneminder by "sudo apt-get install zoneminder" will not work because of missing dependencies (as of 05/01/2019)



Installing libmp4v2-2

Download and compile libmp4v2-2:

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mp4v2/mp4v2-2.0.0.tar.bz2

tar xf mp4v2-2.0.0.tar.bz2
cd mp4v2-2.0.0/
mkdir build/ && cd build/
../configure CXXFLAGS='-fpermissive' CFLAGS='-fpermissive'
make

Don't leave this folder.


Install libmp4v2-2 as debian package:

sudo checkinstall

Follow the instructions on the screen. Enter anything for the description (e.g. Libraries for Zoneminder MP4 support). On the table of values: change the entries as following:

  • Name=libmp4v2-2
  • Version=2.0
  • Provides=libmp4v2-2

Repacking zoneminder deb-package and installation

We have to repack the zoneminder deb-package to fix the dependencies issue (libx264-155).

Download the current deb-package:

wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-1.32/+files/zoneminder_1.32.3-disco_amd64.deb

Extract the deb-package:

ar x zoneminder_1.32.3-disco_amd64.deb
tar xf control.tar.xz

Rewrite the required dependencies:

nano control

search for "libx264-155" and move it after "libx264-152 | ".

Repack the deb-package:

tar c {post,pre}{inst,rm} md5sums control | gzip -c > control.tar.gz
ar rcs zoneminder_1.32.3-disco_repacked_amd64.deb debian-binary control.tar.gz data.tar.xz


Install Zoneminder:

sudo gdebi zoneminder_1.32.3-disco_repacked_amd64.deb

Other missing dependencies will automaticely be installed.



Post-installation procedures

Create the Database:

The database is not created automatically. Create the database with:

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


Fix permissions:

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


Enable Apache features:

sudo a2enmod cgi
sudo a2enmod rewrite
sudo a2enconf zoneminder

sudo service apache2 restart


Add user www-data to group video, for accessing local cameras:

sudo adduser www-data video
sudo usermod -a -G video www-data


Enable Zoneminder service:

systemctl enable zoneminder.service


Add timezone to PHP:

sudo nano /etc/php/7.2/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 = Europe/Luxembourg

CTRL +o Enter to save, then CTRL +x to exit



Finally, restart Apache and zoneminder

sudo service apache2 reload
sudo service zoneminder restart


Zoneminder should work! Open Zoneminder in a web browser (http://server-ip/zm).