Difference between revisions of "Ubuntu Server or Desktop Zoneminder 1.34.x"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 3: Line 3:
Here are the basic commands you will need. As always start from a root (sudo su) prompt.
Here are the basic commands you will need. As always start from a root (sudo su) prompt.


mysql_secure_installation
Secure MySQL or Mariadb


nano /etc/mysql/my.cnf
mysql_secure_installation


[mysqld]
Add entry into my.cnf
sql_mode = NO_ENGINE_SUBSTITUTION


apt install zoneminder
nano /etc/mysql/my.cnf


mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
Add the following to the end of the file


mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION


mysqladmin -uroot -p reload
CTRL + o
CTRL +x


chmod 740 /etc/zm/zm.conf
Install Zoneminder


chown root:www-data /etc/zm/zm.conf
apt install zoneminder


systemctl enable zoneminder.service
The database is not created automatically. Create the database with


adduser www-data video
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql


a2enmod cgi
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"


a2enmod rewrite
mysqladmin -uroot -p reload


a2enconf zoneminder
Fix permissions


nano /etc/php/7.2/apache2/php.ini
chmod 740 /etc/zm/zm.conf


chown -R www-data:www-data /usr/share/zoneminder/
chown root:www-data /etc/zm/zm.conf


service apache2 restart
chown -R www-data:www-data /usr/share/zoneminder/
 
Enable Zoneminder service
 
systemctl enable zoneminder.service
 
Add a user for local cameras
 
adduser www-data video
 
Enable Apache Features
 
a2enmod cgi
 
a2enmod rewrite
 
a2enconf zoneminder
 
Add timezone to PHP
 
nano /etc/php/7.2/apache2/php.ini
 
Search for [Date] (Ctrl + w then type Date and press Enter) 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 reload
 
Zoneminder should work! Open Zoneminder in a web browser (http://server-ip/zm).

Revision as of 20:22, 20 October 2018

Zoneminder 1.30.4 made it into the "official" Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use a very minimum install from the 18.10 mini.iso.

Here are the basic commands you will need. As always start from a root (sudo su) prompt.

Secure MySQL or Mariadb

mysql_secure_installation

Add entry into my.cnf

nano /etc/mysql/my.cnf

Add the following to the end of the file

[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION

CTRL + o CTRL +x

Install Zoneminder

apt install zoneminder

The database is not created automatically. Create the database with

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

Fix permissions

chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/

Enable Zoneminder service

systemctl enable zoneminder.service

Add a user for local cameras

adduser www-data video

Enable Apache Features

a2enmod cgi
a2enmod rewrite
a2enconf zoneminder

Add timezone to PHP

nano /etc/php/7.2/apache2/php.ini

Search for [Date] (Ctrl + w then type Date and press Enter) 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 reload

Zoneminder should work! Open Zoneminder in a web browser (http://server-ip/zm).