Debian 10 Buster with Zoneminder 1.36.x from ZM Repo
Debian 10 Buster with Zoneminder 1.32.3 from the Debian Multimedia Repository
Install Debian Buster. I used the net install CD and installed only web server, SSH server and standard system utilities from tasksel.
Login and become root. I have added sudo and permissions for my user and have omitted the use of sudo before each command.
sudo su
Install additional LAMP components
apt install php mariadb-server php-mysql libapache2-mod-php7.3
Secure Mariadb, create root password et. al.
mysql_secure_installation
Install Zoneminder
Add the Deb Multimedia repository. (instructions at: https://deb-multimedia.org/)
Edit sources.list
nano /etc/apt/sources.list
Add to the end of the file:
deb http://www.deb-multimedia.org buster main non-free
Ctrl+o Enter to save
Ctrl+x to exit
After you have added the necessary line in /etc/apt/sources.list the first package to install is deb-multimedia-keyring.
wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
apt update
Install Zoneminder
apt install zoneminder vlc-plugin-base
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)
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
Set permissions
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/
chown -R www-data:www-data /var/cache/zoneminder/
Enable Zoneminder service to start at boot
systemctl enable zoneminder.service
Add www-data to the sudo group (to enable use of local video devices)
adduser www-data video
Start Zoneminder
systemctl start zoneminder.service
Check to see that Zoneminder is running
systemctl status zoneminder.service
Enable CGI and Zoneminder configuration in Apache.
a2enmod cgi
a2enmod rewrite
a2enconf zoneminder
Add timezone to PHP
nano /etc/php/7.3/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
To get the API working you need to create .htaccess in 3 places and add the code below. (Thanks Chimaera!)
nano /usr/share/zoneminder/www/api/.htaccess
nano /usr/share/zoneminder/www/api/app/.htaccess
nano /usr/share/zoneminder/www/api/app/webroot/.htaccess
Codefor .htaccess files:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteBase /zm/api </IfModule>
Ctrl+o Enter to save
CTRL+x to exit
Restart Apache
service apache2 restart
All done! Navigate to http://serverip/zm