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


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

Revision as of 12:41, 13 March 2018

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.

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

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

Install Zoneminder

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