Difference between revisions of "Debian 10 Buster with Zoneminder 1.36.x from ZM Repo"
Line 2: | Line 2: | ||
Install Debian Buster. I used the net install CD and installed only | Install Debian Buster. I used the net install CD and installed only SSH server and standard system utilities from tasksel. | ||
You will need to install LAMP. One good guide to do this can be found here: | |||
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10 | |||
Install Zoneminder | Install Zoneminder | ||
Line 23: | Line 14: | ||
Edit sources.list | Edit sources.list | ||
nano /etc/apt/sources.list | sudo nano /etc/apt/sources.list | ||
Add to the end of the file: | Add to the end of the file: | ||
Line 37: | Line 28: | ||
wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb | 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 | sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb | ||
apt update | sudo apt update | ||
Install Zoneminder | Install Zoneminder | ||
apt install zoneminder vlc-plugin-base | sudo apt install zoneminder vlc-plugin-base | ||
Line 56: | Line 47: | ||
Set permissions | Set permissions | ||
chmod 740 /etc/zm/zm.conf | sudo chmod 740 /etc/zm/zm.conf | ||
chown root:www-data /etc/zm/zm.conf | sudo chown root:www-data /etc/zm/zm.conf | ||
chown -R www-data:www-data /usr/share/zoneminder/ | sudo chown -R www-data:www-data /usr/share/zoneminder/ | ||
chown -R www-data:www-data /var/cache/zoneminder/ | sudo chown -R www-data:www-data /var/cache/zoneminder/ | ||
Enable Zoneminder service to start at boot | Enable Zoneminder service to start at boot | ||
systemctl enable zoneminder.service | sudo systemctl enable zoneminder.service | ||
Add www-data to the sudo group (to enable use of local video devices) | Add www-data to the sudo group (to enable use of local video devices) | ||
adduser www-data video | sudo adduser www-data video | ||
Start Zoneminder | Start Zoneminder | ||
systemctl start zoneminder.service | sudo systemctl start zoneminder.service | ||
Check to see that Zoneminder is running | Check to see that Zoneminder is running | ||
systemctl status zoneminder.service | sudo systemctl status zoneminder.service | ||
Enable CGI and Zoneminder configuration in Apache. | Enable CGI and Zoneminder configuration in Apache. | ||
a2enmod cgi | sudo a2enmod cgi | ||
a2enmod rewrite | sudo a2enmod rewrite | ||
a2enconf zoneminder | sudo a2enconf zoneminder | ||
Add timezone to PHP | Add timezone to PHP | ||
nano /etc/php/7.3/apache2/php.ini | sudo 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 | Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone | ||
[Date] | [Date] | ||
; Defines the default timezone used by the date functions | ; Defines the default timezone used by the date functions | ||
; http://php.net/date.timezone | ; http://php.net/date.timezone | ||
date.timezone = America/New_York | date.timezone = America/New_York | ||
Ctrl+o Enter to save | Ctrl+o Enter to save | ||
Line 105: | Line 96: | ||
To get the API working you need to Edit zoneminder.conf | To get the API working you need to Edit zoneminder.conf | ||
nano /etc/apache2/conf-enabled/zoneminder.conf | sudo nano /etc/apache2/conf-enabled/zoneminder.conf | ||
At the end of the file add: | At the end of the file add: | ||
Line 115: | Line 106: | ||
RewriteBase /zm/api | RewriteBase /zm/api | ||
</Directory> | </Directory> | ||
<Directory /usr/share/zoneminder/www/api/app> | <Directory /usr/share/zoneminder/www/api/app> | ||
RewriteEngine on | RewriteEngine on | ||
Line 121: | Line 113: | ||
RewriteBase /zm/api | RewriteBase /zm/api | ||
</Directory> | </Directory> | ||
<Directory /usr/share/zoneminder/www/api/app/webroot> | <Directory /usr/share/zoneminder/www/api/app/webroot> | ||
RewriteEngine On | RewriteEngine On | ||
Line 135: | Line 128: | ||
Restart Apache | Restart Apache | ||
service apache2 restart | sudo service apache2 restart | ||
All done! Navigate to http://serverip/zm | All done! Navigate to http://serverip/zm |
Revision as of 09:36, 17 July 2019
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 SSH server and standard system utilities from tasksel.
You will need to install LAMP. One good guide to do this can be found here:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10
Install Zoneminder
Add the Deb Multimedia repository. (instructions at: https://deb-multimedia.org/)
Edit sources.list
sudo 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
sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
sudo apt update
Install Zoneminder
sudo 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
sudo chmod 740 /etc/zm/zm.conf
sudo chown root:www-data /etc/zm/zm.conf
sudo chown -R www-data:www-data /usr/share/zoneminder/
sudo chown -R www-data:www-data /var/cache/zoneminder/
Enable Zoneminder service to start at boot
sudo systemctl enable zoneminder.service
Add www-data to the sudo group (to enable use of local video devices)
sudo adduser www-data video
Start Zoneminder
sudo systemctl start zoneminder.service
Check to see that Zoneminder is running
sudo systemctl status zoneminder.service
Enable CGI and Zoneminder configuration in Apache.
sudo a2enmod cgi
sudo a2enmod rewrite
sudo a2enconf zoneminder
Add timezone to PHP
sudo 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 Edit zoneminder.conf
sudo nano /etc/apache2/conf-enabled/zoneminder.conf
At the end of the file add:
<Directory /usr/share/zoneminder/www/api> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] RewriteBase /zm/api </Directory>
<Directory /usr/share/zoneminder/www/api/app> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] RewriteBase /zm/api </Directory>
<Directory /usr/share/zoneminder/www/api/app/webroot> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteBase /zm/api </Directory>
Ctrl+o Enter to save
CTRL+x to exit
Restart Apache
sudo service apache2 restart
All done! Navigate to http://serverip/zm