Ubuntu Server 18.04 64-bit with Zoneminder 1.32.x the easy way

From ZoneMinder Wiki
Revision as of 13:02, 19 October 2015 by Bbunge (talk | contribs)
Jump to navigationJump to search

15OCT15 Zoneminder 1.28.107 has been added to the PPA and includes API support. This how to has been edited to reflect the change.

If you install Ubuntu from server CD, install OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)

If you use the minimum Ubuntu ISO CD, install Basic Server, OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)


Log in then become root:

sudo su

If you used the server install CD

apt-get update
apt-get upgrade
apt-get dist-upgrade

Optional: Set static IP address

nano /etc/network/interfaces

Make changes similar to this:

auto eth0
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

Add Repository

add-apt-repository ppa:iconnor/zoneminder
apt-get update

Install Zoneminder

apt-get install zoneminder

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 teh

command line which is not secure!

Go to the root directory

cd ~

Create a hidden password file

nano .my.cnf

Enter this content (but use your MySQL root password!)

[client]
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';"

Remove password file

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

systemctl enable zoneminder.service

Create a new user

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/php5/apache2/php.ini

Search for [Date] 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


Install Cambozola (needed if you use Internet Explorer)


cd /usr/src && wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz

replace 936 in the following with cambozola version downloaded

cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder/www

You should now be able to access the web server using https://servername

Optional NTP Daily Sync

nano /etc/cron.daily/ntpdate

Copy the following into nano

!/bin/sh ntpdate ntp.ubuntu.com

Ctrl+o Enter to save

CTRL+x to exit

chmod 755 /etc/cron.daily/ntpdate

Open Zoneminder in web browser

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