Difference between revisions of "SuSE 10.1 and ZoneMinder"

From ZoneMinder Wiki
Jump to navigationJump to search
 
(18 intermediate revisions by the same user not shown)
Line 19: Line 19:
yes">  </span>It seemed that if I skipped any of the additional packages, I’d
yes">  </span>It seemed that if I skipped any of the additional packages, I’d
run into trouble.<span style="mso-spacerun: yes">  </span><br>
run into trouble.<span style="mso-spacerun: yes">  </span><br>
<br>


=== Fresh install SuSE 10.1 OSS (CD install)===
=== Fresh install of SuSE 10.1 OSS (CD install)===
Base installation with KDE Desktop and additional packages
Base installation with KDE Desktop and additional packages
<br>
<br>
Line 55: Line 56:
:Path : suse/10.1
:Path : suse/10.1


=== Go into YAST Software Management ===
=== Configure via YAST Software Management ===


;Verify that these packages are installed, Install any that are missing  (Enter each name in Search box)
;Verify that these packages are installed, Install any that are missing  (Enter each name in Search box)
Line 65: Line 66:
:*apache2-mod-apparmor
:*apache2-mod-apparmor
:*php5  
:*php5  
:*php5-mysql
:*mysql  
:*mysql  
:*mysql-devel  
:*mysql-devel  
Line 81: Line 83:
<br>
<br>


===Updating perl CPANand installing perl packages===  
===Update perl with CPAN and install perl packages===  
I've done all off the perl related installation under user root because of problems with cpan packages installation.  It seems like a slow process, have patience.
I've done all off the perl related installation under user root because of problems with cpan packages installation.  It seems like a slow process, have patience.
<br>
<br>
Line 115: Line 117:
  sudo /etc/rc.d/mysql start
  sudo /etc/rc.d/mysql start


===Downloading and installing latest Zoneminder release (v1.22.2) :===  
===Download and install latest Zoneminder release (v1.22.2) :===  


'''Download and save ZoneMinder tarball from:'''
'''Download and save ZoneMinder tarball from:'''<br>
http://www2.zoneminder.com/downloads/ZoneMinder-1.22.2.tar.gz
http://www2.zoneminder.com/downloads/ZoneMinder-1.22.2.tar.gz


Line 123: Line 125:
From within a Terminal window, inside directory that ZoneMinder download was saved to
From within a Terminal window, inside directory that ZoneMinder download was saved to
  tar zxvf ZoneMinder-1.22.2.tar.gz  
  tar zxvf ZoneMinder-1.22.2.tar.gz  
  cd ZoneMinder-1.22.2  
  cd ZoneMinder-1.22.2


===Download and apply the v1.22.2 patch for ffmpeg from Wiki===
===Download and apply the v1.22.2 patch for ffmpeg from Wiki===
Line 133: Line 135:
:* Open a command shell (terminal window)
:* Open a command shell (terminal window)
:* Change directory to your ZoneMinder build directory  
:* Change directory to your ZoneMinder build directory  
:* Apply the patch by typing  
:* Apply the patch by typing the following command
:patch -p0 < zm-1.22.2-ffmpeg.patch
:patch -p0 < zm-1.22.2-ffmpeg.patch
:* Check that the patch is applied correctly and you do not get any rejects  
:* Check that the patch is applied correctly and you do not get any rejects  
:* If necessary rebuild, then reinstall  
:* If necessary rebuild, then reinstall


===Configuration Time===
===Configure ZoneMinder===
Within Terminal window, in ZoneMinder-1.22.2 directory
Within a Terminal window, in ZoneMinder-1.22.2 directory
  ./configure --with-webdir=/srv/www/htdocs --with-cgidir=/srv/www/cgi-bin --with-webgroup=www --with-webuser=wwwrun ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zm
  ./configure --with-webdir=/srv/www/htdocs --with-cgidir=/srv/www/cgi-bin --with-webgroup=www --with-webuser=wwwrun ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zm


===Configure MySQL===
===Configure MySQL===


Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory and Login to MySQL  (PW is blank)
Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory and Login to MySQL  (PW is probably blank)
  mysql -h localhost -u root -p  
  mysql -h localhost -u root -p  


Under MySQL prompt type
'''Under the MySQL prompt -'''
(Entering Each line will echo a bunch of lines, just ignore them)
(Entering Each line will echo a bunch of lines, just ignore them)
  source db/zm_create.sql; grant select,insert,update,delete on zm.* to 'zm'@localhost identified by 'zm'; flush privileges; quit  
  source db/zm_create.sql;
 
grant select,insert,update,delete on zm.* to 'zm'@localhost identified by 'zm';
flush privileges;
quit


===Compile ZoneMinder===
===Compile ZoneMinder===
Line 163: Line 167:
  su -  
  su -  
  # from zoneminder source directory  
  # from zoneminder source directory  
  cp scripts/zm /etc/rc.d cd /etc/rc.d  
  cp scripts/zm /etc/rc.d  
cd /etc/rc.d  
  chmod +x zm  
  chmod +x zm  
  cd rc5.d  
  cd rc5.d  
  ln -s ../zm S99zm  
  ln -s ../zm S99zm  
  ln -s ../zm K00zm  
  ln -s ../zm K00zm


'''Logoff and logon as root, or create a new session as root.'''
===Logoff and logon as root, or create a new session as root.===


===Edit /etc/rc.d/zm with your favorite text editor (kwrite ?)===
;Edit /etc/rc.d/zm with your favorite text editor (kwrite ?)
'''remove''' the line related to include functions  
: '''remove''' the line related to include functions  
'''replace''' all occurences of echo_success by echo success  
: '''replace''' all occurences of echo_success by echo success  
'''replace''' all occurences of echo_failure by echo failure  
: '''replace''' all occurences of echo_failure by echo failure  
'''save''' the changes (ie :x!)  
: '''save''' the changes (ie :x!)


===Minor changes in the htdocs folder===
===Make minor changes in the htdocs folder===
Copy the /srv/www/htdocs/zm.php  file on top of the /srv/www/htdocs/index.php file. <br>  Rename or delete the /srv/www/htdocs/index.html file
Copy the /srv/www/htdocs/zm.php  file on top of the /srv/www/htdocs/index.php file. <br>  Rename or delete the /srv/www/htdocs/index.html file


===Deal with the Shared Memory problem===  
===Deal with the Shared Memory problem===  
Add the following lines to your /etc/sysctl.conf file:  
Add the following lines to your /etc/sysctl.conf file: <br>
(I chose 256,000,000 because my cams are 640x480)
(I chose 256,000,000 because my cams are 640x480)
  # Memory modifications for ZoneMinder
  # Memory modifications for ZoneMinder
Line 200: Line 205:
If that doesn’t work, try http://localhost/zm.php
If that doesn’t work, try http://localhost/zm.php


===Create your monitor and start playing===  
===Create your monitor and start viewing===  


Here are some options I use when configuring a monitor for my Axis IP camera at 640x480, color.:
Here are some options I use when configuring a monitor for my Axis IP camera at 640x480, color.:
Line 211: Line 216:
:*Maximum FPS = 4.0
:*Maximum FPS = 4.0
:*Alarm Maximum FPS = 8.0
:*Alarm Maximum FPS = 8.0
<br>


;Under the Source Tab
;Under the Source Tab

Latest revision as of 17:18, 19 October 2006

Dgsconseil was kind enough to write a step-by-step newbie kit to install ZoneMinder under SUSE 10.0 OSS.   I copied it and modified it to for SuSE 10.1 with a GUI and the KDE.

This is only a short How-To on how I installed SuSE and ZoneMinder software on SUSE 10.1 OSS, it is not intended to be a reference because I do not specify any of the security rules or optimizations needed for a production server.  I just specify the main steps to get Zone Minder Running.

By the way, this is not the smallest installation possible.  It’s just what I used and it worked.  It seemed that if I skipped any of the additional packages, I’d run into trouble. 

Fresh install of SuSE 10.1 OSS (CD install)

Base installation with KDE Desktop and additional packages

Additional Software Packages chosen during install
  • Graphical Base system
  • KDE Desktop Environment
  • All of KDE
  • Help and Supports Docs
  • Office applications
  • Multimedia
  • Simple Web Server with Apache2
  • LDAP Server and Tools
  • Network and Server
  • C/C++ Complier and Tools
  • Kernel Development
  • KDE Development
  • TCL/TK development system
  • Java
  • Experienced user
  • LaTex, SGML and XML


If using the firewall, add HTTP Server to the Allowed Services list, if you want to access ZoneMinder with a web browser.

Once the Installation is finished, open the YAST control center. (Under System)

If you have an internet connection - In YAST, add packman as an http installation source(used to install ffmpeg)
Type : HTTP
Server : packman.unixheads.com
Path : suse/10.1

Configure via YAST Software Management

Verify that these packages are installed, Install any that are missing (Enter each name in Search box)
  • apache2
  • apache2-worker
  • apache2-mod_perl
  • apache2-mod_php5
  • apache2-mod-apparmor
  • php5
  • php5-mysql
  • mysql
  • mysql-devel
  • gcc
  • gcc-c++
  • libmpeg2
  • libmpeg2-devel
  • ffmpeg
  • libffmpeg0
  • libffmpeg0-devel
  • libjpeg
  • libjpeg-devel
  • pcre-devel
  • xawtv
  • openssl-devel


Update perl with CPAN and install perl packages

I've done all off the perl related installation under user root because of problems with cpan packages installation. It seems like a slow process, have patience.

From within a Terminal window:

perl -MCPAN -e shell 
install Bundle::CPAN 
reload CPAN 
install Archive::Tar (seems to be  optional => depend on the way you install yourdistro)
install Archive::Zip (seems to be optional => depend on the way you install yourdistro)  
install MIME::Lite 
install MIME::Tools 
install DateTime 
install Date::Manip updated 2006-03-04 thanx to mickecarlsson 
install Bundle::libnet 
install Device::SerialPort 
install Astro::SunTime Updated 2006 03 24 correct spelling error on SunTime (thanx to mickecarlsson) 
install X10 


Configure servers to be started at boot time

From within a terminal window:

su - 
cd /etc/rc.d/rc5.d 
ln -s ../apache2 S98apache2 
ln -s ../apache2 K01apache2 
ln -s ../mysql S98mysql 
ln -s ../mysql K01mysql

Start servers manually

From within a terminal window:

sudo /etc/rc.d/apache2 start
sudo /etc/rc.d/mysql start

Download and install latest Zoneminder release (v1.22.2) :

Download and save ZoneMinder tarball from:
http://www2.zoneminder.com/downloads/ZoneMinder-1.22.2.tar.gz

Extract tarball
From within a Terminal window, inside directory that ZoneMinder download was saved to

tar zxvf ZoneMinder-1.22.2.tar.gz 
cd ZoneMinder-1.22.2

Download and apply the v1.22.2 patch for ffmpeg from Wiki

http://www.zoneminder.com/wiki/index.php/1.22.2_Patches

To apply the patch you should do the following

  • Download the patch and move a copy to your ZoneMinder build directory
  • Open a command shell (terminal window)
  • Change directory to your ZoneMinder build directory
  • Apply the patch by typing the following command
patch -p0 < zm-1.22.2-ffmpeg.patch
  • Check that the patch is applied correctly and you do not get any rejects
  • If necessary rebuild, then reinstall

Configure ZoneMinder

Within a Terminal window, in ZoneMinder-1.22.2 directory

./configure --with-webdir=/srv/www/htdocs --with-cgidir=/srv/www/cgi-bin --with-webgroup=www --with-webuser=wwwrun ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zm

Configure MySQL

Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory and Login to MySQL (PW is probably blank)

mysql -h localhost -u root -p 

Under the MySQL prompt - (Entering Each line will echo a bunch of lines, just ignore them)

source db/zm_create.sql;
grant select,insert,update,delete on zm.* to 'zm'@localhost identified by 'zm';
flush privileges;
quit

Compile ZoneMinder

Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory Now compile and install this nice piece of software !

make 
sudo make install 


Configure ZoneMinder to be started at boot time

Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory

su - 
# from zoneminder source directory 
cp scripts/zm /etc/rc.d 
cd /etc/rc.d 
chmod +x zm 
cd rc5.d 
ln -s ../zm S99zm 
ln -s ../zm K00zm

Logoff and logon as root, or create a new session as root.

Edit /etc/rc.d/zm with your favorite text editor (kwrite ?)
remove the line related to include functions
replace all occurences of echo_success by echo success
replace all occurences of echo_failure by echo failure
save the changes (ie :x!)

Make minor changes in the htdocs folder

Copy the /srv/www/htdocs/zm.php file on top of the /srv/www/htdocs/index.php file.
Rename or delete the /srv/www/htdocs/index.html file

Deal with the Shared Memory problem

Add the following lines to your /etc/sysctl.conf file:
(I chose 256,000,000 because my cams are 640x480)

# Memory modifications for ZoneMinder
kernel.shmall = 256000000 
kernel.shmmax = 256000000 

Now you can reboot your computer to apply changes

Well we are at the end of the process...
Start all servers if they are not already started when you boot your computer : From within a Terminal window

sudo /etc/rc.d/apache2 start
sudo /etc/rc.d/mysql start
sudo zmpkg.pl start 

Now open your web browser and point to http://localhost/ If that doesn’t work, try http://localhost/zm.php

Create your monitor and start viewing

Here are some options I use when configuring a monitor for my Axis IP camera at 640x480, color.:

Under the General Tab
  • Source Type = Remote
  • Function = Modetect
  • Enabled = Checked
  • Linked Monitors = (leave it blank)
  • Maximum FPS = 4.0
  • Alarm Maximum FPS = 8.0


Under the Source Tab
  • Remote host name = IP of camera (i.e. 192.168.3.2)
  • Remote Host Port = 80
  • Remote Host Path = /axis-cgi/jpg/image.cgi?resolution=640x480
  • Remote Image Colours = 24 bit colour
  • Capture Width = 640
  • Capture Height = 480


If you want to utilize mpeg instead of jpeg, use this for the host path:
Remote Host Path = /axis-cgi/mjpg/video.cgi?

Additional Information
ZoneMinder Logs are in /tmp
zmaudit.log
zmupdate.log
zmwatch.log => take attention to this one because the shared memory problem is reported here
zmpkg.log
zmdc.log


Apache2 Logs are in /var/logs