更新debian系统
apt update
apt upgrade
apt dist-upgrade
搭建 LAMP 环境,使用 Mariadb 数据库。
apt install php mariadb-server php-mysql apache2-mod-php7.0
配置 Mariadb, 更改 root 密码。
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.
Ctrl+o Enter to save
CTRL+x to exit
Restart Mariadb
service mariadb restart
安装 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 stretch 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.
apt update
apt install deb-multimedia-keyring
If apt-get can not find the new key, do that :
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
Update packages list:
apt update
apt upgrade
apt dist-upgrade
Install Zoneminder
apt install zoneminder vlc-plugin-base php7.0-gd
Set permissions of /etc/zm/zm.conf to root:www-data 740
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
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.0/apache2/php.ini
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Be sure to remove the ; before date.timezone
[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
Change permissions in /usr/share/zoneminder/
chown -R www-data:www-data /usr/share/zoneminder/
Restart Apache
service apache2 restart
Open Zoneminder in a web browser (http://server-ip/zm).
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.
已知问题:/tmp/zm在zoneminder无法使用,请转到选项 -- >路径,然后检查每个PATH_XXX变量。 如果它是“/tmp/zm”,将其更改为“/dev/shm”。 然后重新启动zoneminder。
网友评论