Ubuntu Server 9.04 - ZM 1.24.2 Source Installation Guide

Forum for questions and support relating to the 1.24.x releases only.
quietas
Posts: 102
Joined: Wed May 23, 2007 5:30 pm

Post by quietas »

BTW, here are the complete instructions all edited together. I added the Mmap memory options and the perl command to install the needed addon. I also cleaned up the layout slightly.
INSTALL SERVER OS
Install Ubuntu Server 9.04 amd64. Do not install any packages other than openssh-server.

GO SUDO AND STAY THERE FOR ENTIRE INSTALLATION
sudo -i

UPDATE SERVER OS
apt-get update; apt-get dist-upgrade

CHANGES FOR LIB PATHS
echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc
echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc
ldconfig

INSTALL ALL PREREQUISITES
apt-get install build-essential linux-headers-`uname -r` automake perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl apache2 php5-mysql libapache2-mod-php5 mysql-server libmysqlclient15-dev libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libjpeg62 libjpeg62-dev libmime-perl libstdc++6 libwww-perl zlib1g zip unzip patch ntp openssl libpcre3-dev libssl-dev libjpeg-progs libcurl4-gnutls-dev munin munin-node libmime-lite-perl netpbm libbz2-dev subversion sysvconfig checkinstall

INSTALL PERL MODULES
perl -MCPAN -e shell
install CPAN
install YAML PHP::Serialization Module::Load X10::ActiveHome
install Sys::Mmap
exit

INSTALL FFMPEG
cd /usr/src
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-shared --enable-pthreads
make
checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --default
ldconfig

INSTALL AND CONFIGURE ZONEMINDER
cd /usr/src
svn co http://svn.zoneminder.com/svn/zm/trunk zm
cd zm

./configure --with-webdir=/var/www --with-cgidir=/usr/lib/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --enable-debug=yes --with-webgroup=www-data --with-webuser=www-data --enable-mmap=yes

aclocal
autoconf
automake
make

mysql -u root -p < db/zm_create.sql
mysql -u root -p

grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
flush privileges;
quit

checkinstall --fstrans=no --install=yes --pkgname=ZoneMinder --pkgversion "1.24.svn`date +%Y%m%d`" --default

INSTALL CAMBOZOLA
cd /usr/src
wget http://www.charliemouse.com:8080/code/c ... est.tar.gz
tar -xzvf cambozola-latest.tar.gz
cp cambozola-0.76/dist/cambozola.jar /var/www

INSTALL JSCALENDAR
cd /usr/src
wget http://prdownloads.sourceforge.net/jsca ... p?download
unzip jscalendar-1.0.zip
mkdir /var/www/tools/jscalendar
cp -R jscalendar-1.0/* /var/www/tools/jscalendar

REMOVE EXISTING index.html
rm /var/www/index.html

CREATE ZONEMINDER STARTUP SCRIPT
nano /etc/init.d/zm

(PASTE THE FOLLOWING)

#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 99 99

# Source function library.
#. /etc/rc.d/init.d/functions

prog=ZoneMinder
ZM_PATH_BIN="/usr/local/bin"
command="$ZM_PATH_BIN/zmpkg.pl"

start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
return $RETVAL
}
stop() {
echo -n "Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}

case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL

(SAVE AND EXIT)

MAKE ZM STARTUP SCRIPT EXECUTABLE
chmod 755 /etc/init.d/zm

USE sysvconfig TO START ZONEMINDER UPON REBOOT
sysvconfig

IF YOU ARE USING UBUNTU amd64 VERSION CREATE SYMBOLIC LINKS
cd /usr/lib64
ln -s /usr/local/lib/libswscale.so.0 ./libswscale.so.0
ln -s /usr/local/lib/libavformat.so.52 ./libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.52 ./libavcodec.so.52
ln -s /usr/local/lib/libavutil.so.50 ./libavutil.so.50
ln -s /usr/local/lib/libavdevice.so.52 ./libavdevice.so.52

REBOOT THE SERVER
/sbin/shutdown now -r

INSTALL mysqltuner
sudo -i
apt-get install mysqltuner

STOP ZONEMINDER
/etc/init.d/zm stop

STOP MYSQL
/etc/init.d/mysql stop

EDIT YOUR my.cnf FILE
nano /etc/mysql/my.cnf

UNCOMMENT skip-innodb OR ADD IT IF IT IS NOT IN THERE

MAKE SURE THE THE FOLLOWING PARAMETERS ARE SET
key_buffer = 16M
max_allowed_packet = 32M
thread_stack = 128K
thread_cache_size = 8
query_cache_limit = 1M
query_cache_size = 24M

ADD THESE PARAMETERS
tmp_table_size = 32M
max_heap_table_size = 16M

SAVE AND EXIT

START MYSQL
/etc/init.d/mysql start

START ZONEMINDER
/etc/init.d/zm start

IF YOU WANT TO TUNE YOUR OWN SYSTEM, LET YOUR SYSTEM RUN NORMALLY FOR ABOUT 15 MINUTES AND THEN RUN
mysqltuner

IT WILL ASK YOU FOR YOUR MYSQL ROOT USERNAME AND PASSWORD SO ENTER IT

ONCE YOU ENTER YOUR USERNAME AND PASSWORD IT WILL GIVE YOU SOME RECOMMENDATIONS. I WOULD GUESS THAT IF YOU APPLY THE ABOVE SETTINGS IT WILL NOT RECOMMEND ANY CHANGES.

You can disregard this:
General recommendations
Enable the slow query log to troubleshoot bad queries
radix
Posts: 8
Joined: Thu Oct 09, 2008 8:11 pm

Post by radix »

Cool :), I have run it!
One more thing, I have Creative USB webcam, I have connected it to computer, for example throught ZM live cd ZM sees it but shows no pictures, now I can't even see my camera is connected, any sugestions? maybe I have to somehow install it?
quietas
Posts: 102
Joined: Wed May 23, 2007 5:30 pm

Post by quietas »

Once in Zoneminder there is a button "Add Monitors" that is where you set up cameras in ZM.

You'll need to lookup how to use the Creative USB webcam though. That is one thing I have not tried yet. The wiki or forums should have something about how to use it with a bit of searching.
lbetanzo
Posts: 2
Joined: Fri Oct 16, 2009 8:09 pm

The install is very good until you INSTALL AND CONFIGURE ZM

Post by lbetanzo »

the download with the svn is ok but where you try:
./configure --with-webdir=/var/www --with-cgidir=/usr/lib/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --enable-debug=yes --with-webgroup=www-data --with-webuser=www-data


the following error comes:
checking for pnmscale... no
checking for pnmscale... no
checking for mysql_init in -lmysqlclient... no
configure: error: zm requires libmysqlclient.a


and the all the following instruccions dont work because it dosent create de zm_create.sql it only exit the zm_create.sql.in

I am workin with kubuntu 9.1 beta and the machine is a intel 64 with kunbuntu amd64

Can you tell me how can I solve this I am just learning linux........ thanks in advance for your help
scribble
Posts: 5
Joined: Fri Oct 16, 2009 11:01 am

Post by scribble »

Hi,

Following the tutorial here in an attempt to install ZoneMinder, i got to the point of issuing the command

"perl -MCPAN -e shell"

then installed CPAN with

"install CPAN"

Following the tutorial i exited the perl shell and then issued the command again to enter the shell

"perl -MCPAN -e shell"

Except this time i was thrown the following error,

Error while requiring CPAN::Config:
Can't find string terminator "]" anywhere before EOF at /etc/perl/CPAN/Config.pm line 26.
Compilation failed in require at /usr/local/share/perl/5.8.8/CPAN/HandleConfig.pm line 485.



I am really stuck on this one, i have been searching for a few hours now. What is my best course of action? am i able to re-install CPAN without entering the perl shell? Any help is appreciated.



Thanks for your time,
scribble
stustev
Posts: 3
Joined: Mon Nov 09, 2009 4:28 am

Post by stustev »

ok
I followed the instructions. I have zm running. I can run zm from a firefox on another computer.
I get the same red source and black screen as when I installed ZoneMinder using synaptic.
I thought the compile would fix the access problems
Can you tell me how to troubleshoot this?
Some ideas on what to look for
Some ideas on where to look
I really really want this to work
I spent part of the afternoon fixing a window in my shop. Last night around 10:30 PM someone cut barbed wire on the top of the perimeter fence. Cut the phone line wires and the cable wires. Broke out the window of the man door on the back of the shop. This person then learned the building was occupied and left. This is only getting worse.
thanks in advance
Stuart
pizzacam
Posts: 1
Joined: Sat Feb 20, 2010 5:09 pm

zmpkg.pl not found

Post by pizzacam »

i think i followed each step in the installation guide. however in the end, when i try to start the zm console using /etc/init.d/zm start, i got "zmpkg.pl" not found?

which step i missed? thanks in advance!
technocp
Posts: 2
Joined: Tue Feb 01, 2011 4:50 am

zm service not starting

Post by technocp »

when i issue the following command

/etc/init.d/zm start

i get following error

Starting ZoneMinder: Can't connect: No such file or directory at /usr/local/share/perl/5.10.0/ZoneMinder/Debug.pm line 349
ZoneMinder::Debug::Fatal('Can\'t connect: No such file or directory') called at /usr/local/bin/zmdc.pl line 168
failure
oldStrogg
Posts: 2
Joined: Fri Feb 04, 2011 10:30 am

Post by oldStrogg »

Starting ZoneMinder: Can't connect: No such file or directory at /usr/local/share/perl/5.10.0/ZoneMinder/Debug.pm line 349
ZoneMinder::Debug::Fatal('Can\'t connect: No such file or directory') called at /usr/local/bin/zmdc.pl line 168
failure
Same problem here.
Ubuntu 10.10
Step by step installation. Exept in INSTALL ALL PREREQUISITES libmysqlclient15-dev changed to libmysqlclient-dev (no such apt), and sysvconfig to sysvinit-utils.

Is it relative to a new version 1.24.3 downloaded as svn co http://svn.zoneminder.com/svn/zm/trunk zm

2technocp,
Do you solv it? And/or do you try a 1.24.2 version?[/code][/quote]
Locked