Debian 9 with Zoneminder 1.30.4

17FEB19 This procedure can be used to install Zoneminder on a Raspberry Pi. I used a Pi3 B+.

08OCT17 - This procedure has been verified with the Debian 9.2.0.

Note: 23JUN17 - I was able to get the libvlc source to work! I have added the install for vlc-plugin-base which allows the Zoneminder install to complete without errors. However, I have been getting some console errors from VLC. It may be my old camera and you may have good results with libvlc but I consider ffmpeg better to use.

Login and become root (su root) or prepend sudo to the following commands

If needed check to make sure you are up to date

apt update
apt upgrade
apt dist-upgrade

Install additional LAMP components Mariadb server (recommended)

apt install php mariadb-server php-mysql libapache2-mod-php7.0

Secure Mariadb, create root password et. al.

mysql_secure_installation

NOTE:The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link (this also works for MySQL 5.6).

rm /etc/mysql/my.cnf

cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf

The following change to Mariadb settings is optional but is included if you have problems logging into Zoneminder

nano /etc/mysql/my.cnf

Make the following changes:

character-set-server = latin1
collation-server = latin1_swedish_ci

Note: The above settings are actually the Mariadb default. Changing back to default is necessary to avoid errors when logging into Zoneminder. This was added on 01APR17 but is not an April Fool! It may be necessary to align these settings with your regional language.

10OCT17 - An issue with the /tmp/zm directory has been reported. Debian uses private tmp folders so even though you can see the files & folders, zoneminder cannot because it is running under a different user account.

Go to Options -> Paths and then inspect each PATH_XXX variable. If it is set to "/tmp/zm", change it to "/dev/shm". Don't forget to restart zoneminder.

Alternate install MySQL Server

Note: Install of MySQL was not tested with the Debian 9.0.0 release but should work based on past experience

apt install php default-mysql-server php-mysql apache2-mod-php7.0

Make a change to MySQL settings: (Note: Your my.cnf may be in another location)

nano /etc/mysql/my.cnf

In the [mysqld] section add the following

sql_mode = NO_ENGINE_SUBSTITUTION

Note: if you are installing on an existing database server you can use the following as an alternate to 'sql_mode = NO_ENGINE_SUBSTITUTION' (Thanks to "bodom" for this alternate):