ZoneMinder on Ubuntu 9.10 32bit - Vanilla Fresh Install - (with FFmpeg SVN, ZoneMinder SVN, jscalendar-1.0, cambozola-0.76)
From ZoneMinder Wiki
Revision as of 15:16, 20 December 2009 by Jsylvia007 (talk | contribs)
ZoneMinder on Ubuntu 9.10 32bit - Vanilla Fresh Install - (with FFmpeg SVN, ZoneMinder SVN, jscalendar-1.0, cambozola-0.76)
Update Ubuntu 9.10
aptitude update aptitude full-upgrade reboot
For this section, I will refer you to the following 2 posts:
Using these calculations, for 6GB of Physical Memory I would use this:
echo "#Below are for ZoneMinder#" >> /etc/sysctl.conf echo "kernel.shmall = 1536000" >> /etc/sysctl.conf echo "kernel.shmmax = 3221225472" >> /etc/sysctl.conf
Install All Prerequisites
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 checkinstall
Install Perl Modules
perl -MCPAN -e shell install CPAN exit perl -MCPAN -e shell install YAML PHP::Serialization Module::Load X10::ActiveHome Sys::Mmap exit
FFmpeg & ZoneMinder from SVN
Install FFmpeg
cd /usr/src svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg > /usr/src/XXX_FFMPEG_LOG.txt 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 cd /lib ln -s /usr/local/lib/libswscale.so.0 ln -s /usr/local/lib/libavformat.so.52 ln -s /usr/local/lib/libavcodec.so.52 ln -s /usr/local/lib/libavutil.so.50 ln -s /usr/local/lib/libavdevice.so.52
Install & Config ZoneMinder
cd /usr/src svn co http://svn.zoneminder.com/svn/zm/trunk zm > /usr/src/XXX_ZM_LOG.txt 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 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.2-svn`date +%Y%m%d`" --default
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.76/dist/cambozola.jar /var/www
Install jscalendar-1.0
cd /usr/src wget http://prdownloads.sourceforge.net/jscalendar/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
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
Make /etc/init.d/zm executable:
chmod 755 /etc/init.d/zm
Install Webmin
cd /usr/src wget http://downloads.sourceforge.net/project/webadmin/webmin/1.500/webmin_1.500_all.deb dpkg -i webmin_1.500_all.deb
Login to Webmin via: https://SERVERIP:10000
Navigate to: System --> Bootup & Shutdown
Select the check next to "zm" and press the "Start at Boot" button
- Webmin notice: after installing Webmin 1.500 update the System Logs via: Unused Modules > System Logs > Module Config, change the default /etc/syslog.conf to /etc/rsyslog.conf
Reboot System
Again, this is meant to be installed on a FRESH install of 9.10 with no modifications. Also, this guide is meant to be run as root, as such I have left out all the 'sudo' prefixes.
Please try and let me know your success. I've installed this way 3 times from scratch on a virtual machine, and I think this guide is now complete.