Zoneminder – Security Cam server – Ubuntu 16.04

Zoneminder is a Security camera Server and management platform, controlled via Webinterface.

 

Installer Zoneminder fra Ubuntu 16.04
Under installation af Ubuntu server vælges lampstack og openssh server.
Ellers kan der LAMP stakken installeres fra tasksel

sudo apt install tasksel
sudo tasksel install lamp
# opdater ubuntu
sudo -i
add-apt-repository ppa:iconnor/zoneminder
apt update; apt upgrade; reboot

# fjern gammel sql config og installer ny sql config
sudo -i
rm /etc/mysql/my.cnf
cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
nano /etc/mysql/my.cnf

# indsæt under [mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION

systemctl restart mysql

# installer zoneminder
apt install zoneminder php-gd

# ret bruger rettigheder
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
adduser www-data video

a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/

# ret filen, skift fra None til All
nano /etc/apache2/apache2.conf
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

# start zoneminder
systemctl enable zoneminder
systemctl start zoneminder
# Ret php dato
nano /etc/php/7.0/apache2/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Copenhagen

systemctl restart apache2
# Log på via webbrowser
http://ipadresse/zm

Vælg settings og path
Ret variablen PATH_ZMS til /zm/cgi-bin/nph-zms
Opret en bruger
Under fanebladet system sættes OPT_USE_AUTH med et hak for at aktivere login skærm.

 

 

Og nu til at aktivere SSL
# Opret ssl key/certifikat/nøgler

a2enmod ssl
openssl genrsa -out hmezoneminder.key 2048
openssl req -new -key hmezoneminder.key -out hmezoneminder.csr
openssl x509 -req -days 365 -in hmezoneminder.csr -signkey hmezoneminder.key -out hmezoneminder.crt
mv hmezoneminder.crt /etc/ssl/certs/
mv hmezoneminder.key /etc/ssl/certs/
nano /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
ServerName hmezoneminder
ServerAdmin webmaster@localhost
ServerAlias hmezoneminder
Redirect permanent / https://hmezoneminder/zm

</VirtualHost>

<VirtualHost *:443>
ServerName hmezonemindersecure
ServerAdmin webmaster@localhost
ServerAlias hmezonemindersecure
DocumentRoot /var/www/html/
SSLEngine on
SSLCertificateFile /etc/ssl/certs/hmezoneminder.crt
SSLCertificateKeyFile /etc/ssl/certs/hmezoneminder.key
</VirtualHost>