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

From ZoneMinder Wiki
Jump to navigationJump to search
Line 1: Line 1:
As of 03JUL15 there is a package in the PPA for Vivid Zoneminder. This how to has been edited to reflect the change.
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 install Ubuntu from server CD, install OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)
Line 34: Line 34:
Reboot server
Reboot server


CGI is not enabled in Ubuntu 15.04 by default. Enable it this way:
Add Repository
 
add-apt-repository ppa:iconnor/zoneminder-master
 
apt-get update
 
Install Zoneminder
 
apt-get install zoneminder


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


Restart Apache
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


service apache2 restart
command line which is not secure!


Add Repository
Go to the root directory
   
   
  add-apt-repository ppa:iconnor/zoneminder
  cd ~
 
  apt-get update
Create a hidden password file
 
  nano .my.cnf


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


  apt-get install zoneminder
  [client]
user=root
password=(mysqlpass)


You may need to install "extra" VLC components (I will check this and edit as needed)
Ctrl+o Enter to save


apt-get install libvlc-dev libvlccore-dev vlc
CTRL+x to exit


Create a file called zoneminder.conf
Create database (press ENTER after each command)


  nano /etc/tmpfiles.d/zoneminder.conf
  mysql < /usr/share/zoneminder/db/zm_create.sql


Paste or enter the following
mysql -e "grant select,insert,update,delete,create on zm.* to 'zmuser'@localhost identified by 'zmpass';"


d /var/run/zm 0755 www-data www-data
Remove password file


CTRL+o to save the file
rm .my.cnf
CTRL+x to exit nano
Set permissions of /etc/zm/zm.conf to root:www-data 740


Change permissions on the file
chmod 740 /etc/zm/zm.conf


  chmod 755 /etc/tmpfiles.d/zoneminder.conf
  chown root:www-data /etc/zm/zm.conf


Enable Zoneminder
Enable Zoneminder service to start at boot


  systemctl enable zoneminder.service
  systemctl enable zoneminder.service
Create a new user
adduser www-data video


Start Zoneminder
Start Zoneminder
Line 83: Line 100:
  systemctl status zoneminder.service
  systemctl status zoneminder.service


Enable CGI and Zoneminder configuration in Apache.


Create a symbolic link
a2enmod cgi


  ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf
  a2enmod rewrite


a2enconf zoneminder


Create a new user
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


  adduser www-data video
CTRL+x to exit  


Restart Apache
Restart Apache


  service apache2 restart
  service apache2 restart


Install Cambozola (needed if you use Internet Explorer)
Install Cambozola (needed if you use Internet Explorer)
Line 106: Line 137:
replace 936 in the following with cambozola version downloaded
replace 936 in the following with cambozola version downloaded


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


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

Revision as of 16:17, 15 October 2015

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)

Note: This install is for the iconnor/zoneminder PPA. As of 19AUG15 this installs Zoneminder 1.28.2.

There is a newer version of Zoneminder in the iconnor/zoneminder-master PPA but my test install did not include an automatic database install and I could not get this version of Zoneminder to work. I will keep an eye on this version and post updates in the forum. As for now if you want a Zoneminder install that works use this one!

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-master
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