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

From ZoneMinder Wiki
Jump to navigationJump to search
(Created page with "<Home Zoneminder 1.30.4 made it into the "official" Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use...")
 
 
(34 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Ubuntu|<Home]]
'''Zoneminder 1.33.x on Ubuntu 19.10'''


Zoneminder 1.30.4 made it into the "official" Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use a very minimum install from the 18.10 mini.iso.
As of 31DEC19 there is no Zonemiinder 1.33.x package in the zoneminder-master PPA for Ubuntu 19.10. This uses Gdebi to install the Ubuntu Disco package.


Here are the basic commands you will need. As always start from a root (sudo su) prompt.
After installing a basic Ubuntu 19.10 OS add LAMP with Mariadb or MySQL.  


Secure MySQL or Mariadb
__TOC__
 
===19.10 with Mariadb Server===
To install LAMP with Mariadb Server see: https://www.techsupportpk.com/2019/10/how-to-install-lamp-stack-ubuntu-1910.html
 
Become root
 
sudo su
 
Install Gdebi
 
apt install gdebi
 
Download the Zoneminder Disco .deb package
 
wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18539544/+files/zoneminder_1.33.16~20200109103850-disco_arm64.deb
 
'''Note: if the above wget download fails with a can't find the file... check the zoneminder-master PPA for the correct file name. This will happen when the Zoneminder package is updated.'''
 
Download libmp4v2-2
 
wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/17493816/+files/libmp4v2-2_2.0.0~dfsg0-6_amd64.deb
 
Download libmysqlclient20
 
wget http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb
 
Install libmysqlclient20
 
gdebi libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb
 
Install libmp4v2-2
 
gdebi libmp4v2-2_2.0.0~dfsg0-6_amd64.deb
 
Install Zoneminder
 
gdebi zoneminder_1.33.16~20200109103850-disco_arm64.deb
Fix permissions:
 
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
Enable and start Zoneminder
 
systemctl enable zoneminder.service
systemctl start zoneminder
 
Enable Apache Modules
 
a2enconf zoneminder
a2enmod rewrite
Restart Apache
 
service apache2 reload
 
Open Zoneminder console and set your timezone under Options/Timezone
 
===19.10 with MySQL Server===
After installing a basic Ubuntu 19.10 OS add LAMP from tasksel
 
Become root
 
sudo su
 
Secure MySQL if you haven't already done it. Do not activate VALIDATE PASSWORD COMPONENT.


  mysql_secure_installation
  mysql_secure_installation


Add entry into my.cnf
Edit MySQL configuration to use native password
nano /etc/mysql/mysql.conf.d/mysqld.cnf
 
Below [mysqld] add
 
default_authentication_plugin = mysql_native_password


  nano /etc/mysql/my.cnf
CTRL + o to save
CTRL +x to exit


Add the following to the end of the file
restart MySQL


  [mysqld]
  systemctl restart mysql
sql_mode = NO_ENGINE_SUBSTITUTION


CTRL + o
Install Gdebi
CTRL +x


Restart MySQL
apt install gdebi


  systemctl restart mysql
Download the Zoneminder Disco .deb package
 
  wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18539544/+files/zoneminder_1.33.16~20200109103850-disco_arm64.deb
 
Download libmp4v2-2
 
wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/17493816/+files/libmp4v2-2_2.0.0~dfsg0-6_amd64.deb


Install Zoneminder
Download libmysqlclient20


  apt install zoneminder
  wget http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb


The database is not created automatically. Create the database with
Install libmysqlclient20


  mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
  gdebi libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb


mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Install libmp4v2-2


  mysqladmin -uroot -p reload
  gdebi libmp4v2-2_2.0.0~dfsg0-6_amd64.deb


Fix permissions
Install Zoneminder


  chmod 740 /etc/zm/zm.conf
  gdebi zoneminder_1.33.16~20200109103850-disco_arm64.deb


chown root:www-data /etc/zm/zm.conf
Note: The Zoneminder package will not complete successfully and will show errors. This will be corrected in the next step.


chown -R www-data:www-data /usr/share/zoneminder/
Create (overwrite) Zoneminder database


Enable Zoneminder service
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql


systemctl enable zoneminder.service
Create user and set permissions (press Enter after each entry)


Add a user for local cameras
mysql (Enter MySQL processing)


  adduser www-data video
  mysql> CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';


Enable Apache Features
mysql> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;


  a2enmod cgi
  mysql> FLUSH PRIVILEGES ;


  a2enmod rewrite
  mysql> \q


a2enconf zoneminder
Reload MySQL


Add timezone to PHP
mysqladmin -uroot -p reload


nano /etc/php/7.2/apache2/php.ini
Fix permissions:


Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/


[Date]
Enable and start Zoneminder
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York


Ctrl+o Enter to save
systemctl enable zoneminder.service
systemctl start zoneminder


CTRL+x to exit
Enable Apache Modules


a2enconf zoneminder
a2enmod rewrite
Restart Apache
Restart Apache


  service apache2 reload
  service apache2 reload


Zoneminder should work! Open Zoneminder in a web browser (http://server-ip/zm).
Open Zoneminder console and set your timezone under Options/Timezone

Latest revision as of 12:42, 21 March 2020

Zoneminder 1.33.x on Ubuntu 19.10

As of 31DEC19 there is no Zonemiinder 1.33.x package in the zoneminder-master PPA for Ubuntu 19.10. This uses Gdebi to install the Ubuntu Disco package.

After installing a basic Ubuntu 19.10 OS add LAMP with Mariadb or MySQL.

19.10 with Mariadb Server

To install LAMP with Mariadb Server see: https://www.techsupportpk.com/2019/10/how-to-install-lamp-stack-ubuntu-1910.html

Become root

sudo su

Install Gdebi

apt install gdebi

Download the Zoneminder Disco .deb package

wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18539544/+files/zoneminder_1.33.16~20200109103850-disco_arm64.deb

Note: if the above wget download fails with a can't find the file... check the zoneminder-master PPA for the correct file name. This will happen when the Zoneminder package is updated.

Download libmp4v2-2

wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/17493816/+files/libmp4v2-2_2.0.0~dfsg0-6_amd64.deb

Download libmysqlclient20

wget http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb

Install libmysqlclient20

gdebi libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb

Install libmp4v2-2

gdebi libmp4v2-2_2.0.0~dfsg0-6_amd64.deb

Install Zoneminder

gdebi zoneminder_1.33.16~20200109103850-disco_arm64.deb

Fix permissions:

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

Enable and start Zoneminder

systemctl enable zoneminder.service
systemctl start zoneminder 

Enable Apache Modules

a2enconf zoneminder
a2enmod rewrite

Restart Apache

service apache2 reload

Open Zoneminder console and set your timezone under Options/Timezone

19.10 with MySQL Server

After installing a basic Ubuntu 19.10 OS add LAMP from tasksel

Become root

sudo su

Secure MySQL if you haven't already done it. Do not activate VALIDATE PASSWORD COMPONENT.

mysql_secure_installation

Edit MySQL configuration to use native password

nano /etc/mysql/mysql.conf.d/mysqld.cnf

Below [mysqld] add

default_authentication_plugin = mysql_native_password

CTRL + o to save CTRL +x to exit

restart MySQL

systemctl restart mysql

Install Gdebi

apt install gdebi

Download the Zoneminder Disco .deb package

wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18539544/+files/zoneminder_1.33.16~20200109103850-disco_arm64.deb

Download libmp4v2-2

wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/17493816/+files/libmp4v2-2_2.0.0~dfsg0-6_amd64.deb

Download libmysqlclient20

wget http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb

Install libmysqlclient20

gdebi libmysqlclient20_5.7.28-0ubuntu0.19.04.2_amd64.deb

Install libmp4v2-2

gdebi libmp4v2-2_2.0.0~dfsg0-6_amd64.deb

Install Zoneminder

gdebi zoneminder_1.33.16~20200109103850-disco_arm64.deb

Note: The Zoneminder package will not complete successfully and will show errors. This will be corrected in the next step.

Create (overwrite) Zoneminder database

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql

Create user and set permissions (press Enter after each entry)

mysql (Enter MySQL processing)
mysql> CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';
mysql> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES ;
mysql> \q

Reload MySQL

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 and start Zoneminder

systemctl enable zoneminder.service
systemctl start zoneminder 

Enable Apache Modules

a2enconf zoneminder
a2enmod rewrite

Restart Apache

service apache2 reload

Open Zoneminder console and set your timezone under Options/Timezone