Code: Select all
INSTALL SERVER OS
Perform a fresh install Ubuntu Server 11.04 amd64 DO NOT install any packages during the initial install other than openssh-server.
GO SUDO AND STAY THERE FOR ENTIRE INSTALLATION
sudo -i
UPDATE SERVER OS
apt-get update; apt-get dist-upgrade
REBOOT
/sbin/shutdown now -r
SET A STATIC IP (optional)
nano /etc/network/interfaces
INSTALL ALL ZONEMINDER PREREQUISITES
apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libx11-dev libxvidcore-dev zlib1g-dev build-essential linux-headers-`uname -r` automake perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apache2 php5-mysql libapache2-mod-php5 mysql-server libmysqlclient16-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 sysvinit-utils ffmpeg x264 libx264-dev curl lynx coreutils bc
INSTALL PERL MODULES
perl -MCPAN -e shell
install CPAN
install YAML PHP::Serialization Module::Load X10::ActiveHome
install Sys::Mmap
exit
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
make
make install
mysql < db/zm_create.sql
mysql
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
flush privileges;
quit
INSTALL CAMBOZOLA
cd /usr/src
wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
cp cambozola-0.92/dist/cambozola.jar /var/www
INSTALL JSCALENDAR
cd /usr/src
wget -O jscalendar-1.0.zip "http://sourceforge.net/projects/jscalendar/files/jscalendar/1.0/jscalendar-1.0.zip/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
SET SHARED MEMORY SETTINGS
echo "kernel.shmall = 268435456" >> /etc/sysctl.conf
echo "kernel.shmmax = 268435456" >> /etc/sysctl.conf
CREATE STARTUP SCRIPT
Use nano or vi to create/edit /etc/init.d/zm
nano /etc/init.d/zm (then 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: "
if ! [ -d /tmp/zm ]; then
mkdir /tmp/zm
chown -R www-data:www-data /tmp/zm
fi
$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
(then save and exit)
SETUP ZM TO STARTUP AUTOMATICALLY AFTER A REBOOT
nano /etc/rc.local
(paste the following above the exit 0 line):
sleep 20 && /etc/init.d/zm start
(then save and exit)
SET PERMISSIONS ON STARTUP SCRIPT
chmod 755 /etc/init.d/zm
REBOOT THE SERVER
/sbin/shutdown now -r
LOGIN TO ZONEMINDER
Open a web browser and visit http://ipaddressofyourserver
MAKE SURE YOU SET YOUR purgewhenfull filter!