ZONEMINDER: (1.32.3) Instalación zoneminder debian 9

Instalación de zoneminder
  • Paso 1: instalamos dependencias
apt install php mariadb-server php-mysql apache2-mod-php7.0 apache2
  • Paso 2: creamos contraseña de usuario «root» de mariaDB
mysql_secure_installation
  • Pasos:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): ENTER
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
  • Paso 3: reemplazar el archivo de configuración de MYSQL por el de MARIADB
rm /etc/mysql/my.cnf  
cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf
  • Paso 4: asegurar que en el el archivo de configuración de MariaDB
nano /etc/mysql/my.cnf
  • Existe:
character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci
  • Además comentar la siguiente linea para poder ingresar con un usuario remoto
#bind-address            = 127.0.0.1
  • Paso 5: reiniciar mariaDB
service mariadb restart
  • Paso 6: Agregar al sources.list
nano /etc/apt/sources.list
  • AGREGAR:
deb https://zmrepo.zoneminder.com/debian/release stretch/
  • Paso 7: instalamos, obtenemos llave y actualizamos
apt install apt-transport-https -y
wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add -
  • Paso 9: actualizamos el sistema
apt update && apt upgrade && apt dist-upgrade
  • Paso 10: Instalamos zoneminder
apt install zoneminder vlc-plugin-base php7.0-gd -y
  • Paso 11: establecemos permisos al archivo de configuración
chmod 740 /etc/zm/zm.conf
  • Paso 12: modificamos el dueño
chown root:www-data /etc/zm/zm.conf
  • Paso 13: establecemos que Zoneminder inicie al arrancar el sistema
systemctl enable zoneminder.service
  • Paso 14: agregar el usuario «www-data» al grupo «video»
adduser www-data video
  • Paso 15: Iniciamos Zoneminder
systemctl start zoneminder.service
  • Paso 16: verificamos que arranco correctamente
systemctl status zoneminder.service
* zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2017-11-10 16:06:46 UTC; 12min ago
Main PID: 23492 (zmdc.pl)
CGroup: /system.slice/zoneminder.service
> 23492 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
  • Paso 17: Habilitamos los módulos de apache
a2enmod cgi
a2enmod rewrite
a2enconf zoneminder
systemctl reload apache2
  • Paso 18: establecemos la zona horaria en PHP
nano /etc/php/7.0/apache2/php.ini
  • MODIFICAR:
;date.timezone =
X
date.timezone = America/Costa_Rica
  • Paso 19: cambiar dueño de sistema zoneminder
chown -R www-data:www-data /usr/share/zoneminder/
  • Paso 20: reiniciamos apache
service apache2 restart