Difference between revisions of "SuSE 10.1 and ZoneMinder"

From ZoneMinder Wiki
Jump to navigationJump to search
 
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
<p class=MsoNormal><span class=name1><span style='font-size:9.0pt;mso-bidi-font-size:8.5pt;font-family:Verdana'>Dgsconseil was kind enough to write a<b> </b></span></span><span
class=postbody1><span style='font-size:9.0pt;font-family:Verdana'>step-by-step
newbie kit to install ZoneMinder under <b><span style='color:#FFA34F'>SUSE</span></b>
10.0 OSS.<span style="mso-spacerun: yes">   </span></span></span><span
style='font-size:9.0pt;font-family:Verdana'>I copied it and modified it to for
SuSE 10.1 with a GUI and the KDE.<br>
<br>


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.  
<span class=postbody1>This is only a short How-To on how I installed SuSE and
ZoneMinder software on <b><span style='color:#FFA34F'>SUSE</span></b> 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.<span
style="mso-spacerun: yes">  </span>I just specify the main steps to get Zone
Minder Running. </span><br>
<br>
<span style='font-size:9.0pt;font-family:Verdana'>By the
way, this is '''not''' the smallest installation possible.<span style="mso-spacerun:
yes">  </span>It’s just what I used and it worked.<span style="mso-spacerun:
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>
<br>


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
<br>


'''Fresh install Suse 10.1 OSS  (CD install) ""
;Additional Software Packages chosen during install:
"'Base installation with KDE Desktop and additional packages'"
:*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


'''Additional Software Packages chosen during install:'''
<br>
Graphical Base system
''If using the firewall, add HTTP Server to the Allowed Services list, if you want to access ZoneMinder with a web browser.''
KDE Desktop Environment
<br>
All of KDE
<br>
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)'''
<br>


;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


== Once the Installation is finished, open the YAST control center.  (Under System) ==
=== Configure via YAST Software Management ===


;Verify that these packages are installed, Install any that are missing  (Enter each name in Search box)


If you have an internet connection: In YAST, add packman as an http installation source
:*apache2
(used to install ffmpeg)
:*apache2-worker 
Type : HTTP
:*apache2-mod_perl
Server : packman.unixheads.com
:*apache2-mod_php5
Path : suse/10.1
:*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
<br>


Go into YAST Software Management
===Update perl with CPAN and install perl packages===
 
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
mysql
mysql-devel
gcc
gcc-c++
libmpeg2
libmpeg2-devel
ffmpeg
libffmpeg0
libffmpeg0-devel
libjpeg
libjpeg-devel
pcre-devel
xawtv 
openssl-devel
 
Updating perl CPANand installing 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.
Code:
<br>
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  
<br>
 
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  
<br>


Configure servers to be started at boot time  
===Configure servers to be started at boot time===
Code:  In a terminal window (command shell)
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  
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
===Start servers manually===
Code:
From within a terminal window:
  sudo /etc/rc.d/apache2 start   sudo /etc/rc.d/mysql start
sudo /etc/rc.d/apache2 start
sudo /etc/rc.d/mysql start


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


Downloading and installing latest Zoneminder release (v1.22.2) :
'''Download and save ZoneMinder tarball from:'''<br>
http://www2.zoneminder.com/downloads/ZoneMinder-1.22.2.tar.gz


Download and save ZoneMinder tarball from:
'''Extract tarball''' <br>
[url]http://www2.zoneminder.com/downloads/ZoneMinder-1.22.2.tar.gz[/url]
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


Extract tarball
===Download and apply the v1.22.2 patch for ffmpeg from Wiki===
Code: In a Terminal window, inside directory that ZoneMinder download was saved to
http://www.zoneminder.com/wiki/index.php/1.22.2_Patches
tar zxvf ZoneMinder-1.22.2.tar.gz cd ZoneMinder-1.22.2
<br>


Download and apply the v1.22.2 patch for ffmpeg from Wiki:
'''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


[url]http://www.zoneminder.com/wiki/index.php/1.22.2_Patches[/url]
===Configure ZoneMinder===
Within a Terminal window, in ZoneMinder-1.22.2 directory
To apply the patch you should do the following :-
./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
· 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
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


Now Configuration Time !
===Configure MySQL===
Code:  (be sure you are 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


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)
Code:
mysql -h localhost -u root -p  
mysql -h localhost -u root -p  


Under MySQL prompt type
'''Under the MySQL prompt -'''
Code:  (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===
Within a Terminal window, Make sure you’re in the ZoneMinder-1.22.2 directory
Now compile and install this nice piece of software !  
Now compile and install this nice piece of software !  
Code:
make
make sudo make install  
sudo make install  


   
   
Configure ZoneMinder to be started at boot time  
===Configure ZoneMinder to be started at boot time===
Code:
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  
su -  
 
# from zoneminder source directory  
Logoff and logon as root, or create a new session as root.
cp scripts/zm /etc/rc.d  
cd /etc/rc.d  
chmod +x zm  
cd rc5.d  
ln -s ../zm S99zm  
ln -s ../zm K00zm


edit /etc/rc.d/zm with your favorite text editor (kwrite ?)
===Logoff and logon as root, or create a new session as root.===
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!)


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
;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!)


Deal with the Shared Memory problem
===Make minor changes in the htdocs folder===
Add the following lines to your /etc/sysctl.conf 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
Code: (I chose 256,000,000 because my cams are 640x480)
# Memory modifications for ZoneMinderkernel.shmall = 256000000 kernel.shmmax = 256000000


Now you can reboot your computer to apply changes
===Deal with the Shared Memory problem===
Add the following lines to your /etc/sysctl.conf file: <br>
(I chose 256,000,000 because my cams are 640x480)
# Memory modifications for ZoneMinder
kernel.shmall = 256000000
kernel.shmmax = 256000000


Well we are at the end of the process
'''Now you can reboot your computer to apply changes'''
Start all servers if they are not allready started when you boot your computer :
Code:
sudo /etc/rc.d/apache2 start sudo /etc/rc.d/mysql start sudo zmpkg.pl start


Well we are at the end of the process...
<br>
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 [url]http://localhost/[/url]
Now open your web browser and point to http://localhost/
If that doesn’t work, try [url]http://localhost/zm.php[/url]
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.:


Under the General Tab
;Under the General Tab
Source Type = Remote
:*Source Type = Remote
Function = Modetect
:*Function = Modetect
Enabled = Checked
:*Enabled = Checked
Linked Monitors = (leave it blank)
:*Linked Monitors = (leave it blank)
Maximum FPS = 4.0
:*Maximum FPS = 4.0
Alarm Maximum FPS = 8.0
:*Alarm Maximum FPS = 8.0
 
<br>
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:
;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
<br>
If you want to utilize mpeg instead of jpeg, use this for the host path: <br>
Remote Host Path = /axis-cgi/mjpg/video.cgi?
Remote Host Path = /axis-cgi/mjpg/video.cgi?
<br>


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

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