Ubuntu Server 16.04 64-bit with Zoneminder 1.30.4 the easy way

From ZoneMinder Wiki
Jump to: navigation, search

Temporary install for Zoneminder 1.30.4 on Ubuntu 16.04 64 bit only

The following is a shell script to install Zoneminder 1.30.4 on Ubuntu 16.04 64 bit.

Note: if you had Zoneminder installed you can omit the following two commands from the script

This entry appends the timezone to the php.ini

awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/apache2/php.ini

These add entries to the my.cnf

echo "[mysqld]" >> /etc/mysql/my.cnf
echo "init_connect = 'SET @@sql_mode = CASE CURRENT_USER() WHEN \'zmuser@localhost\' THEN \'NO_ENGINE_SUBSTITUTION\' ELSE @@sql_mode END;'" >> /etc/mysql/my.cnf

Create a file:

nano install-zm

Copy and paste the following contents into the file

#!/bin/sh
clear
read -p "This script installs Zoneminder 1.30.4 on Ubuntu 16.04 AMD64 with LAMP (MySQL) installed. This uses install packages that were  downloaded from the Zoneminder PPA...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "You must be logged in as root using sudo su ...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "Next we will download the Zoneminder install packages, configure MySQL and PHP and install the downloaded packages.
Press enter to continue" nothing
wget --no-check-certificate https://173.163.189.225/php-apcu-bc_1.0.3-2xenial2_amd64.deb -P /tmp/
wget --no-check-certificate https://173.163.189.225/zoneminder-doc_1.30.4-xenial1_all.deb -P /tmp/
wget --no-check-certificate https://173.163.189.225/zoneminder_1.30.4-xenial1_amd64.deb -P /tmp/
clear
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.0/apache2/php.ini
echo "[mysqld]" >> /etc/mysql/my.cnf
echo "init_connect = 'SET @@sql_mode = CASE CURRENT_USER() WHEN \'zmuser@localhost\' THEN \'NO_ENGINE_SUBSTITUTION\' ELSE @@sql_mode END;'" >> /etc/mysql/my.cnf
systemctl restart mysql
apt-get -y install /tmp/php-apcu-bc_1.0.3-2xenial2_amd64.deb
apt-get -y install /tmp/zoneminder-doc_1.30.4-xenial1_all.deb
apt-get -y install /tmp/zoneminder_1.30.4-xenial1_amd64.deb
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
service apache2 reload
clear
read -p "Open Zoneminder in a web browser (http://server-ip/zm). 
Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms 
Click the Save button. 
Press enter to continue" nothing
clear

Save the file

ctrl + o
ctrl + x

Chmod permissions

chmod 755 install-zm

run the file

./install-zm