Installation de zoneminder 1.25.0 sur Centos 6.3
De wikiGite
Sommaire
Prérequis
Systeme
Mettre à jour :
yum -y update
Désactiver SELINUX :
vim /etc/sysconfig/selinux
Ajouter des dépot supplementaires
rpmforge
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt rpm -ihv http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpmfusion pour avoir la version 0.10 de ffmpeg
epel
rpm -Uvh http://mirrors.ircam.fr/pub/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm sed -i 's/enabled = 1/enabled = 0/' /etc/yum.repos.d/epel.repo
rpmfusion
rpm -Uvh http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm sed -i 's/enabled = 1/enabled = 0/' /etc/yum.repos.d/rpmfusion-free-updates.repo sed -i 's/enabled = 1/enabled = 0/' /etc/yum.repos.d/rpmfusion-free-updates-testing.repo sed -i 's/enabled = 1/enabled = 0/' /etc/yum.repos.d/rpmfusion-nonfree-updates.repo sed -i 's/enabled = 1/enabled = 0/' /etc/yum.repos.d/rpmfusion-nonfree-updates-testing.repo
Installation
Installer les dépéndances
yum install gcc gcc-c++ wget mysql-devel mysql-server php php-mysql php-pear php-pear-DB php-mbstring \ bison bison-devel httpd make ncurses ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver \ sox newt-devel libxml2-devel libtiff-devel php-gd audiofile-devel gtk2-devel libv4l-devel \ zlib zlib-devel openssl openssl-devel gnutls-devel php-process perl-Time-HiRes perl-CPAN pcre-devel libjpeg-devel \ perl-Date-Manip perl-libwww-perl perl-Module-Load perl-Net-SFTP-Foreign perl-Archive-Tar perl-Archive-Zip perl-Expect \ perl-MIME-Lite perl-Device-SerialPort
Installer la version 0.10 de ffmpeg
yum install --enablerepo=rpmfusion-free-updates --enablerepo=rpmfusion-nonfree-updates --enablerepo=epel ffmpeg
verifier la version :
ffmpeg -version
Installer les modules perl optionnels:
perl -MCPAN -e 'install Sys::Mmap' perl -MCPAN -e 'install MIME::Entity' perl -MCPAN -e 'install X10::ActiveHome'
Compilation
A cause d'une erreur de compilation due à la version 0.10 de ffmpeg du depot rpmfusion :
zm_local_camera.cpp: In static member function ‘static bool LocalCamera::GetCurrentSettings(const char*, char*, int, bool)’: zm_local_camera.cpp:774: erreur: ‘PATH_MAX’ was not declared in this scope zm_local_camera.cpp:779: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:781: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:782: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:799: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:801: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:811: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:936: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:961: erreur: ‘queryDevice’ was not declared in this scope zm_local_camera.cpp:1086: erreur: ‘queryDevice’ was not declared in this scope make[2]: *** [zm_local_camera.o] Erreur 1 make[2]: quittant le répertoire « /usr/local/src/ZoneMinder-1.25.0/src » make[1]: *** [all-recursive] Erreur 1 make[1]: quittant le répertoire « /usr/local/src/ZoneMinder-1.25.0 » make: *** [all] Erreur 2
il est necessaire de realiser les étapes suivantes : [Source] Editer le fichier :
vim src/zm_local_camera.cpp
Inserer la ligne :
#include <linux/limits.h>
Lancer configure :
CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=MDPDEZMUSER ZM_SSL_LIB=openssl --with-extralibs="-L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib" --with-libarch=lib64 --with-ffmpeg
Puis compiler et installer :
make make install
Mysql
Lancer mysqld :
service mysqld start
Configurer le mot de passe administateur :
/usr/bin/mysqladmin -u root password 'NEWPASSWORD'
Créer la base de donnée pour zoneminder :
mysql -u root -p create database zm; CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'MDPDEZMUSER'; grant CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to zmuser@localhost; FLUSH PRIVILEGES; exit
Remplir la base de donnée :
mysql -u root -p zm < /usr/local/src/ZoneMinder-1.25.0/db/zm_create.sql
Configuration
Copier le script de démarage :
cp /usr/local/src/ZoneMinder-1.25.0/scripts/zm /etc/init.d/ chmod +x /etc/init.d/zm
Activer les services au démarage :
chkconfig zm on chkconfig mysqld onœ chkconfig httpd on
cambozola permet de visualiser des flux mjpeg pour les navigateurs ne supportant pas cette fonctionnalité nativement (IE) :
cd /var/www/html/zm wget http://www.zoneminder.com/sites/zoneminder.com/downloads/cambozola.jar chown apache:apache /var/www/html/zm/cambozola.jar
Editer le fichier /etc/php.ini et ajouter (ou décommenter) cette ligne :
short_open_tag = On
Lancer apache et zoneminder :
service httpd start service zm start
Puis de rendre sur l'interface web http://YOURIP/zm
Suite à des problèmes de droits il faut lancer ces commandes et les ajouter dans /etc/rc.local :
chown -R root:apache /dev/shm chmod 770 /dev/shm chmod 755 /tmp/zm
Tips
Camera avec mot de passe
<username>:<password>@IP
Acceder au flux de la camera en dehors de zoneminder
http://IP_SERVEUR/cgi-bin/nph-zms?mode=jpeg&monitor=1&user=admin&pass=MOT_DE_PASSE
mode : single(1 image) jpeg mpeg monitor : N° de la cam. Il correspond au numero entre () lorsque on configure la cam scale : 0-100 //taille user pass maxfps : nombre max de fps