Difference between revisions of "Ubuntu Server 18.04 64-bit with Zoneminder 1.30.4 the easy way"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 1: Line 1:
'''Ubuntu 18.04 with Zoneminder 1.30.4 Preliminary Install Procedure'''
'''Ubuntu 18.04 with Zoneminder 1.30.4 Preliminary Install Procedure'''


''Notice: 13MAR18 Zoneminder appears to have been removed from the Bionic repositories. Have notified the package maintainer and am searching for a workaround.''
''Notice: 22MAR18 - Zoneminder has been removed from the Ubuntu 18.04, Bionic, repository. PHP updates to version 7.2 also caused some problems which have been resolved (I hope!). This procedure uses a patched install from Zesty along with cakephp and crud updates to work with PHP7.2 ''


''Warning!!! This is a preliminary procedure and changes to the nightly build may cause problems.''
''Warning!!! This is a preliminary procedure and changes to the nightly build may cause problems.''


Ubuntu 18.04 Server Nightly Build (18FEB18) installed with LAMP and OpenSSH Server
Ubuntu 18.04 Bionic Server Nightly Build (22MAR18) installed with LAMP and OpenSSH Server


To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.
Line 41: Line 41:
  mysql_secure_installation
  mysql_secure_installation


Install Zoneminder
Dowmload the Zoneminder install package from:


  apt install zoneminder
  Onedrive https://1drv.ms/u/s!ApMZyp0q7cregdRym0MrU9BeMP_JUQ


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


  mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
  Google Drive https://drive.google.com/open?id=1bZhVcBnlW46SwCnSnZ0sdZzwtOcCiisX


mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Copy zoneminder-1.30.4-bionic-amd64.deb to your home directory. I use Webmin installed on the server to upload the file but you can also use WinSCP.


mysqladmin -uroot -p reload
Install Zoneminder
 
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
  apt install /home/(user)/ zoneminder-1.30.4-bionic-amd64.deb


Enable Zoneminder service to start at boot
Enable Zoneminder service to start at boot
Line 70: Line 66:


  systemctl start zoneminder.service
  systemctl start zoneminder.service
Check to see that Zoneminder is running
systemctl status zoneminder.service


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

Revision as of 16:14, 22 March 2018

Ubuntu 18.04 with Zoneminder 1.30.4 Preliminary Install Procedure

Notice: 22MAR18 - Zoneminder has been removed from the Ubuntu 18.04, Bionic, repository. PHP updates to version 7.2 also caused some problems which have been resolved (I hope!). This procedure uses a patched install from Zesty along with cakephp and crud updates to work with PHP7.2

Warning!!! This is a preliminary procedure and changes to the nightly build may cause problems.

Ubuntu 18.04 Bionic Server Nightly Build (22MAR18) installed with LAMP and OpenSSH Server

To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.

This removes the current symbolic link

rm /etc/mysql/my.cnf  

This moves the MYSQL Configuration file

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf

To change MySQL settings:

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 folowing as an alternate (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

Secure MySQL and set root password (Password not set in nightly build). Do not install the password validation plugin as the default Zoneminder password is not strong.

mysql_secure_installation

Dowmload the Zoneminder install package from:

Onedrive https://1drv.ms/u/s!ApMZyp0q7cregdRym0MrU9BeMP_JUQ

or

Google Drive https://drive.google.com/open?id=1bZhVcBnlW46SwCnSnZ0sdZzwtOcCiisX

Copy zoneminder-1.30.4-bionic-amd64.deb to your home directory. I use Webmin installed on the server to upload the file but you can also use WinSCP.

Install Zoneminder

apt install /home/(user)/ zoneminder-1.30.4-bionic-amd64.deb

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

Enable CGI and Zoneminder configuration in Apache.

a2enmod cgi
a2enmod rewrite
a2enconf zoneminder

Add timezone to PHP

nano /etc/php/7.1/apache2/php.ini

Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Be sure to remove the ; before date.timezone

[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

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