Installazione Zoneminder 1.24 sy ubuntu 9.04

Installazione Zoneminder 1.24 sy ubuntu 9.04

Modifichiamo i File di sistema per la shared memory

echo “#Below are for ZoneMinder#” » /etc/sysctl.conf

echo “kernel.shmall = 1536000” » /etc/sysctl.conf

echo “kernel.shmmax = 3221225472” » /etc/sysctl.conf

Cambiamo i percorsi delle librerie

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

Installiamo tutti i pacchetti che ci serviranno

aptitude 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

Installiamo i moduli per il perl

sudo perl -MCPAN -e shell

install CPAN
exit

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

exit

Installiamo FFmpeg

Installiamo ffmpeg da synaptic

Diamo i seguenti comandi

cd /lib
sudo ln -s /usr/lib/libswscale.so.0
sudo ln -s /usr/lib/libavformat.so.52
sudo ln -s /usr/lib/libavcodec.so.52
sudo ln -s /usr/lib/libavutil.so.50
sudo ln -s /usr/lib/libavdevice.so.52

Compiliamo e installiamo Zoneminder

Istalliamo subversion

sudo apt-get install subversion
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

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';

quit

make install

Post Install

Install cambozola.jar

cd /usr/src
wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
cp cambozola-0.70/dist/cambozola.jar /var/www

Remove existing index.html

rm /var/www/index.html

Make sure ZoneMinder starts automatically

nano -w /etc/init.d/zm
#!/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

Rendiamo /etc/init.d/zm eseguibile:

chmod 755 /etc/init.d/zm

Usiamo “sysvconfig” per configurare ZM

riavviamo il sistema