Maj 10

ZoneMinder – Linux CCTV – Telewizja przemysłowa – Debian 8 Jessie.

 

Specyfikacja karty video.

Single Channel Frame Rate: PAL – 25fps, NTSC – 30fps,
Display Resolution: PAL – 704×576, NTSC – 720×480,

 

Karta Video m@cro-video.com/en model NV7008-N – chipset Philips SAA7134/SAA7135HL

NV7008X

Przeglad urządzeń PCI.

sudo lspci
...
05:01.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:02.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:05.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:06.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:09.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:0a.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:0d.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:0e.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
...

ls -ls /dev/video*
0 crw-rw-rwT 1 root video 81, 0 Oct 17 22:20 /dev/video0
0 crw-rw-rwT 1 root video 81, 3 Oct 17 22:20 /dev/video1
0 crw-rw-rwT 1 root video 81, 6 Oct 17 22:19 /dev/video2
0 crw-rw-rwT 1 root video 81, 9 Oct 17 22:19 /dev/video3
0 crw-rw-rwT 1 root video 81, 12 Oct 17 22:19 /dev/video4
0 crw-rw-rwT 1 root video 81, 14 Oct 17 22:19 /dev/video5
0 crw-rw-rwT 1 root video 81, 16 Oct 17 22:19 /dev/video6
0 crw-rw-rwT 1 root video 81, 18 Oct 17 22:19 /dev/video7

 

Dodanie modułu SAA7134/SAA7135HL.

sudo nano /etc/modprobe.d/options.conf
alias char-major-81 videodev
alias char-major-81-0 saa7134
options saa7134 card=33,33,33,33

 

Jeżeli powyższa metoda nie zadziała, należy zmienić: card=33,33,33,33 na jedna z opcji poniżej:

options saa7134 card=60,60,60,60
lub - options saa7134 card=60,60,60,60,60,60,60,60
lub - options saa7134 card=2,2,2,2,2,2,2,2
lub - options saa7134 card=33,33,33,33,33,33,33,33
lub - options saa7134 card=97,97,97,97
lub - options saa7134 card=73,73,73,73

 

W moim przypadku wszystkie opcje działały poprawnie ale obraz był czarno/biały.
Karta zaczęła działać w kolorze przy ustawieniach: options saa7134 card=2,2,2,2,2,2,2,2.

Konfiguracja modułów innych kart DVR.

http://www.zoneminder.com/wiki/index.php/Hardware_Compatibility_List

Ładowanie modułu SAA7134/SAA7135HL:

sudo modprobe saa7134
sudo lsmod | grep  saa7134
saa7134_alsa           17623  0
snd_pcm                68083  4 snd_hda_codec,snd_hda_intel,snd_hda_codec_hdmi,saa7134_alsa
saa7134               155340  4 saa7134_alsa
tveeprom               20593  1 saa7134
videobuf_dma_sg        13231  2 saa7134,saa7134_alsa
videobuf_core          17825  2 videobuf_dma_sg,saa7134
v4l2_common            13222  2 saa7134,tuner
videodev               70889  6 v4l2_common,saa7134,tuner
snd                    52889  8 snd_timer,snd_hda_codec_via,snd_pcm,snd_hwdep,snd_hda_codec,snd_hda_intel,snd_hda_codec_hdmi,saa7134_alsa
rc_core                18286  17 ir_nec_decoder,saa7134,rc_flyvideo,ir_rc5_decoder,ir_rc6_decoder,ir_jvc_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_lirc_codec
i2c_core               23876  10 i2c_algo_bit,i2c_piix4,videodev,v4l2_common,tveeprom,saa7134,drm,drm_kms_helper,radeon,tuner

 

Instalacja Zoneminder.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libcommon-sense-perl libexpect-perl libio-stty-perl libjson-any-perl libjson-perl libjson-xs-perl libnet-sftp-foreign-perl liburi-encode-perl netpbm
sudo apt-get install git libexpect-perl liburi-encode-perl libnet-sftp-foreign-perl libjson-any-perl libpackage-stash-xs-perl libgcrypt11-dev libgcrypt20-dev libpolkit-gobject-1-dev

sudo apt-get install apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl
sudo apt-get install libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg8-dev libjpeg8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libphp-serialization-perl 
sudo apt-get install libjpeg8-dev libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libv4l-dev libtool ffmpeg libnetpbm10-dev libavdevice-dev libmime-lite-perl dh-autoreconf dpatch

sudo apt-get install libfaad-dev faad libmp4v2-2 libmp3lame-dev libogg-dev libtheora-dev libvorbis-dev libx264-dev libxvidcore-dev x264 libav-tools ffmpeg openssl libvlccore-dev libvlc-dev

 

Budowa pakietów zoneminder.

cd /root
sudo git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder;
cd zoneminder;
sudo ln -s distros/debian8 debian;
sudo dpkg-checkbuilddeps;
sudo dpkg-buildpackage -uc -us

 

Wszystkie stworzone pakiety zoneminder powinny znajdować się w katalogu /root.

sudo ls -1 ~/zoneminder*
sudo ls -1 ~/libzoneminder*
/root/zoneminder_1.28.0+nmu1_all.deb
/root/zoneminder_1.28.0+nmu1_amd64.changes
/root/zoneminder_1.28.0+nmu1.dsc
/root/zoneminder_1.28.0+nmu1.tar.xz
/root/zoneminder-core_1.28.0+nmu1_amd64.deb
/root/zoneminder-core-dbg_1.28.0+nmu1_amd64.deb
/root/zoneminder-database_1.28.0+nmu1_all.deb
/root/zoneminder-ui-base_1.28.0+nmu1_amd64.deb
/root/zoneminder-ui-classic_1.28.0+nmu1_all.deb
/root/zoneminder-ui-mobile_1.28.0+nmu1_all.deb
/root/zoneminder-ui-xml_1.28.0+nmu1_all.deb

/root/libzoneminder-perl_1.28.0+nmu1_all.deb

 

Instalacja pakietów zoneminder.

cd ..

sudo dpkg -i zoneminder_1.28.0+nmu1_all.deb zoneminder-core_1.28.0+nmu1_amd64.deb zoneminder-core-dbg_1.28.0+nmu1_amd64.deb zoneminder-database_1.28.0+nmu1_all.deb zoneminder-ui-base_1.28.0+nmu1_amd64.deb zoneminder-ui-classic_1.28.0+nmu1_all.deb zoneminder-ui-mobile_1.28.0+nmu1_all.deb zoneminder-ui-xml_1.28.0+nmu1_all.deb libzoneminder-perl_1.28.0+nmu1_all.deb

 

W razie niepowodzenia przy instalacji zoneminder’a, należy wymusić instalacje zależności.

sudo apt-get install -f

 

Jeżeli wciąż pojawiają się jakiekolwiek zależności i sprawiają one trudność w instalacji użyj alternatywnej metody instalacji:

sudo aptitude install -y gdebi;
sudo gdebi zoneminder_1.28.0+nmu1_all.deb zoneminder-core_1.28.0+nmu1_amd64.deb zoneminder-core-dbg_1.28.0+nmu1_amd64.deb zoneminder-database_1.28.0+nmu1_all.deb zoneminder-ui-base_1.28.0+nmu1_amd64.deb zoneminder-ui-classic_1.28.0+nmu1_all.deb zoneminder-ui-mobile_1.28.0+nmu1_all.deb zoneminder-ui-xml_1.28.0+nmu1_all.deb libzoneminder-perl_1.28.0+nmu1_all.deb

 

Autotart Zonemindera’ w czasie  boot’owania.

Aby zoneminder startował poprawnie, edytujemy plik  konfiguracyjny zoneminder.service
i dodajemy w sekcji Requires: mysql.service.

sudo nano /lib/systemd/system/zoneminder.service
...
Requires=apache2.service mysql.service
...

 

sudo systemctl enable zoneminder

 

Zmiana wielkości pamięci – Kernel Memory.

Wielkość pamięci należy zmienić pod siebie. Ostatnia linię w pliku konfiguracyjnym należy pozostawić pustą.

sudo nano /etc/sysctl.conf
kernel.shmall = 1048576
kernel.shmmax = 6442450944

sudo sysctl -p /etc/sysctl.conf

 

Zmiana wielkości pamięci dzielonej (do 128MB ) – SHMMAX i SHMALL

sudo nano /proc/sys/kernel/shmmax
134217728

 

Instalacja Jpegturbo.

sudo wget --trust-server-names http://sourceforge.net/projects/libjpeg-turbo/files/1.3.1/libjpeg-turbo-official_1.3.1_amd64.deb/download
sudo dpkg -i libjpeg-turbo*

 

Tworzenie linków.

ln -s /opt/libjpeg-turbo/lib/libjpeg.a /usr/lib/libjpeg.a
ln -s /opt/libjpeg-turbo/include/jconfig.h /usr/include/jconfig.h
ln -s /opt/libjpeg-turbo/include/jerror.h /usr/include/jerror.h
ln -s /opt/libjpeg-turbo/include/jmorecfg.h /usr/include/jmorecfg.h
ln -s /opt/libjpeg-turbo/include/jpeglib.h /usr/include/jpeglib.h

 

sudo echo "/opt/libjpeg-turbo/lib" > /etc/ld.so.conf.d/libjpeg-turbo.conf
sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf
sudo echo "LD_LIBRARY_PATH=/usr/local/lib:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc
sudo echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc

 

Instalacja Cambozola.

wersja stabilna (stara):

sudo wget www.zoneminder.com/sites/zoneminder.com/downloads/cambozola.jar -O /usr/share/zoneminder/cambozola.jar

 

najnowsza wersja (mogą pojawiać się problemy z wydajnością):

sudo wget www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
sudo tar xvf cambozola-latest.tar.gz
sudo cp cambozola*/dist/cambozola.jar /usr/share/zoneminder
sudo rm -fr cambozola-latest.tar.gz

 

Instalacja modułów Perl.

sudo perl -MCPAN -e shell
install CPAN
exit

 

sudo perl -MCPAN -e shell
install YAML PHP::Serialization Module::Load X10::ActiveHome
exit

 

sudo LC_ALL=C perl -MCPAN -e shell
install Sys::Syslog
install DBI
install DBD::mysql
install Getopt::Long
install Time::HiRes
install Date::Manip
install LWP::UserAgent
install ExtUtils::MakeMaker
install Module::Load
install Device::SerialPort
install Net::FTP
install Net::SFTP::Foreign
install Expect
install Archive::Tar
install Archive::Zip
install Net::SMTP
install MIME::Lite
install MIME::Entity
install X10::ActiveHome
exit

sudo ldconfig

 

Testowanie Zoneminder’a, karty wideo i kamer.

Używając komendy poniżej dowiemy się czy karta wideo współgra z Zoneminder’em.

sudo zmu -d /dev/video0 -q -v

 

lub z nazwą użytkownika i hasłem

sudo zmu -U użytkownik -P hasło -d /dev/video0 -q -v

Video Device: /dev/video0
General Capabilities
  Driver: saa7134
  Card: LifeView FlyVIDEO3000
  Bus: PCI:0000:04:01.0
  Version: 3.2.60
  Type: 0x5010015
    Supports video capture (X)
    Does not support video output
    Supports frame buffer overlay
    Supports VBI capture
    Does not support VBI output
    Does not support sliced VBI capture
    Does not support sliced VBI output
    Does not support video output overlay
    Has tuner
    Does not have audio in and/or out
    Does not have radio
    Supports read/write i/o (X)
    Does not support async i/o
    Supports streaming i/o (X)
    Standards:
      NTSC
      NTSC-M
      NTSC-M-JP
      NTSC-M-KR
      PAL
      PAL-BG
      PAL-H
      PAL-I
      PAL-DK
      PAL-M
      PAL-N
      PAL-Nc
      PAL-60
      SECAM
      SECAM-B
      SECAM-G
      SECAM-H
      SECAM-DK
      SECAM-L
      SECAM-Lc
  Formats:
    8 bpp gray (GREY)
    15 bpp RGB, le (RGBO)
    15 bpp RGB, be (RGBQ)
    16 bpp RGB, le (RGBP)
    16 bpp RGB, be (RGBR)
    24 bpp RGB, le (BGR3)
    24 bpp RGB, be (RGB3)
    32 bpp RGB, le (BGR4)
    32 bpp RGB, be (RGB4)
    4:2:2 packed, YUYV (YUYV)
    4:2:2 packed, UYVY (UYVY)
    4:2:2 planar, Y-Cb-Cr (422P)
    4:2:0 planar, Y-Cb-Cr (YU12)
    4:2:0 planar, Y-Cb-Cr (YV12)
Crop Capabilities
  Bounds: 720 x 578
  Default: 720 x 576
  Current: 720 x 576
Inputs: 5
  Input 0
    Name: Television
    Type: Tuner
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected
    Horizontal Lock detected
  Input 1
    Name: TV (mono only)
    Type: Tuner
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected
    Horizontal Lock detected
  Input 2
    Name: Composite1
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected
    Horizontal Lock detected
  Input 3
    Name: Composite2
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected
    Horizontal Lock detected
  Input 4
    Name: S-Video
    Type: Camera
    Audioset: 00000001
    Standards: 0xffbfff
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected
    Horizontal Lock detected

 

Konfiguracja Apache2.

Konfiguracja prosta:
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
sudo adduser www-data video
sudo service apache2 restart

 

Dostęp do ZoneMinder’a:

  • http://localhost/zm
  • http://IP_address/zm
  • http://domain.com/zm

 

Konfiguracja zaawansowana:

Konfiguracja: ssl + virtualhost + subdomena.

Subdomena: zm.domain.com

Zastąp zm.domain.com swoją subdomeną.

sudo mkdir -p /etc/apache2/ssl/zm.domain.com/
cd /etc/apache2/ssl/zm.domain.com/

 

Generacja prywatnego klucza.

sudo openssl genrsa -des3 -out zm.domain.com.key 2048
Generating RSA private key, 2048 bit long modulus
..+++
.............................................................+++
e is 65537 (0x10001)
Enter pass phrase for domain.com.key:
Verifying - Enter pass phrase for zm.domain.com.key:

 

Generacja certyfikatu CSR (Certificate Signing Request).

sudo openssl req -new -key zm.domain.com.key -out zm.domain.com.csr
Enter pass phrase for zm.domain.com.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:Greater Manchester
Locality Name (eg, city) []:Manchester
Organization Name (eg, company) [Internet Widgits Pty Ltd]:ZoneMinder CCTV
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:zm.domain.com
Email Address []:webmaster@domain.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

 

Usuwanie hasła z klucza zm.domain.com.

sudo cp zm.domain.com.key zm.domain.com.key.org
sudo openssl rsa -in zm.domain.com.key.org -out zm.domain.com.key

Enter pass phrase for zm.domain.com.key.org:
writing RSA key

 

Generacja certyfikatu Self-Signed Certificate (10 lat).

openssl x509 -req -days 3650 -in zm.domain.com.csr -signkey zm.domain.com.key -out zm.domain.com.crt

Signature ok
subject=/C=GB/ST=Greater Manchester/L=Manchester/O=ZoneMinder CCTV/OU=IT/CN=zm.domain.com/emailAddress=webmasterr@domain.com
Getting Private key

 

Edycja pliku httpd.conf.

sudo nano /etc/apache2/httpd.conf
<VirtualHost *:80>

ServerName zm.domain.com
ServerAlias *.zm.domain.com
DocumentRoot /usr/share/zoneminder/

ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined

       RewriteEngine On
       RewriteCond %{HTTPS} off
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</Virtual Host> 

<VirtualHost *:443>
ServerName zm.domain.com
ServerAlias *.zm.domain.com
DocumentRoot /usr/share/zoneminder/
        <Directory /usr/share/zoneminder>
                php_flag register_globals off
                Options All +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
                AllowOverride All
                Require all granted
                        <IfModule mod_dir.c>
                                DirectoryIndex index.php
                        </IfModule>
        </Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/zm.domain.com/zm.domain.com.crt 
SSLCertificateKeyFile /etc/apache2/ssl/zm.domain.com/zm.domain.com.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
   "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" 

</Virtual Host>

 

sudo a2enmod ssl
sudo a2ensite zm.domain.com
sudo nano /usr/share/zoneminder/.htaccess

 

# STRONG HTACCESS PROTECTION</code>
<Files ~ "^.*\.([Hh][Tt][Aa])">
Require all denied
</Files>

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^aipbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bloggsi [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^CHATCATCHER [OR]
RewriteCond %{HTTP_USER_AGENT} ^CopyRightCheck [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
RewriteCond %{HTTP_USER_AGENT} ^grub [OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^HTTP://WWW.RELEVANTNOISE.COM [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
RewriteCond %{HTTP_USER_AGENT} ^Java [OR]
RewriteCond %{HTTP_USER_AGENT} ^JAVA [OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
RewriteCond %{HTTP_USER_AGENT} ^looksmart [OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^LMSPIDER [OR]
RewriteCond %{HTTP_USER_AGENT} ^lmspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^MoreOverBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetMechanic [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
RewriteCond %{HTTP_USER_AGENT} ^PYTHON-URLLIB [OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^SHELOB [OR]
RewriteCond %{HTTP_USER_AGENT} ^SIMILARPAGES [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^SphereScout [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^thesubot [OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebBandit [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^weneo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^YANDEX [OR]
RewriteCond %{HTTP_USER_AGENT} ^YandexBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]


sudo service apache2 restart
sudo service zoneminder restart
 

 

Dostęp do ZoneMinder’a:

  • http://zm.domain.com

 

Konfiguracja serwera DNS (bind9).

dodaj do strefy domain.com wpis:

zm              CNAME       zm.domain.com
zm              IN       A      <adres_IP>
sudo service bind9 restart

 

 

Zoneminder – Munin.

Instalacja pluginów zoneminder dla munina.

sudo wget https://github.com/bhuddah/zoneminder_munin/archive/master.zip -O zoneminder_munin.zip
sudo unzip zoneminder_munin.zip
sudo mv zoneminder_munin-master/zoneminder_alarm_stats /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_alarm_stats_individual /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_events /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_events_stats /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_events_total /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_frames_total /usr/share/munin/plugins/
sudo mv zoneminder_munin-master/zoneminder_max_age /usr/share/munin/plugins/
sudo rm -fr zoneminder_munin-master zoneminder_munin.zip

 

Tworzenie symlinków:

sudo ln -s /usr/share/munin/plugins/zoneminder_alarm_stats /etc/munin/plugins/zoneminder_alarm_stats
sudo ln -s /usr/share/munin/plugins/zoneminder_alarm_stats_individual /etc/munin/plugins/zoneminder_alarm_stats_individual
sudo ln -s /usr/share/munin/plugins/zoneminder_events /etc/munin/plugins/zoneminder_events
sudo ln -s /usr/share/munin/plugins/zoneminder_events_stats /etc/munin/plugins/zoneminder_events_stats
sudo ln -s /usr/share/munin/plugins/zoneminder_events_total /etc/munin/plugins/zoneminder_events_total
sudo ln -s /usr/share/munin/plugins/zoneminder_frames_total /etc/munin/plugins/zoneminder_frames_total
sudo ln -s /usr/share/munin/plugins/zoneminder_max_age /etc/munin/plugins/zoneminder_max_age

 

Konfiguracja.

Każdy pobrany plugin należy edytować, zmienić nazwę użytkownika i dodać opcję hasło do dostępu do bazy danych MySQL.

Domyślny użytkownik i hasło do bazy danych zoneminder to:
user: zmuser
password: zmpass

MYSQLOPTS="${mysqlopts:---user=zmuser --password=zmpass --host=localhost}"

 

sudo nano /usr/share/munin/plugins/zoneminder_alarm_stats
sudo nano /usr/share/munin/plugins/zoneminder_alarm_stats_individual
sudo nano /usr/share/munin/plugins/zoneminder_events
sudo nano /usr/share/munin/plugins/zoneminder_events_stats
sudo nano /usr/share/munin/plugins/zoneminder_events_total
sudo nano /usr/share/munin/plugins/zoneminder_frames_total
sudo nano /usr/share/munin/plugins/zoneminder_max_age

 

Zmiana uprawnien do pluginów.

sudo chmod 755 /usr/share/munin/plugins/zoneminder_alarm_stats
sudo chmod 755 /usr/share/munin/plugins/zoneminder_alarm_stats_individual
sudo chmod 755 /usr/share/munin/plugins/zoneminder_events
sudo chmod 755 /usr/share/munin/plugins/zoneminder_events_stats
sudo chmod 755 /usr/share/munin/plugins/zoneminder_events_total
sudo chmod 755 /usr/share/munin/plugins/zoneminder_frames_total
sudo chmod 755 /usr/share/munin/plugins/zoneminder_max_age

 

Restart Munina.

sudo service munin-node restart

 

Restart serwera.

sudo reboot

 

Aplikacja na androida.

ZmVIEW

https://play.google.com/store/apps/details?id=com.html5clouds.zmview

zmview_1 zmview_3 zmview_2

 

Monitor Alert

https://play.google.com/store/apps/details?id=com.html5clouds.monitoralert

monitor allert_1 monitor allert_3 monitor allert_2

 

Aplikacja na iOS.

ZmVIEW

https://itunes.apple.com/app/id948351730

zmview-01 zmview-02 zmview-03

 

Dostęp do strony ZoneMinder.

  • http://localhost/zm
  • http://adres_IP/zm
  • http://domain.com/zm

lub

  • http://zm.domain.com
 

zoneminder

Links:

http://www.zoneminder.com/

 

Eksport video w lepszej jakości:

Logujemy się do Zoneminder, wchodzimy do: Options potem w zakładkę Images.

Przy PATH_FFMPEG zmieniamy program ffmpeg na avconv (avconv to nowa nazwa programu ffmpeg):

PATH_FFMPEG  /usr/bin/avconv

Przy FFMPEG_OUTPUT_OPTIONS zastępujemy opcję -r 25 na:

FFMPEG_OUTPUT_OPTIONS   -r 30 -vcodec libx264 -threads 2 -b 2000k -minrate 800k -maxrate 5000k

zm-video-conf

Zapisujemy i restartujemy Zoneminder.

 

Dodaj komentarz

Twój adres email nie będzie publikowany.