Saturday, December 4, 2010

ZoneMinder 1.24.2 Installation Guide on CentOS 5.5

Most of this is taken from the zoneminder wiki, others from various posts on their forums. I put them all together and this guide works 200%. This guide serves as my cheat sheet and have implemented in several machines. Goodluck!

---

1) yum update then reboot

2) Setup -> Firewall -> disable Security Level and SELinux

3) Disable the following services and then reboot...
apmd
bluetooth
cups
hidd
ip6tables
iptables
netfs
nfslock
pcscd
portmap

4) Add RPM Forge REPO
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

5) Install software needed for ZM Installation:
yum -y install mysql mysql-server mysql-devel php php-gd php-mysql httpd gcc pcre-devel gd mod_ssl glib2-devel gcc-c++ ntp gnutls-devel ImageMagick libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools perl-Date-Manip perl-LWP-UserAgent-Determined perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap.i386 perl-Module-Load subversion git screen yasm

6) Confirm installation and then reboot.

7) Install ffmpeg
rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
yum install ffmpeg ffmpeg-devel

8) Turn on services:
chkconfig httpd on
chkconfig mysqld on
chkconfig ntpd on
ntpdate pool.ntp.org
service httpd start
service mysqld start
service ntpd start

9) Setup your MySQL:
/usr/bin/mysql_secure_installation

10) Download and extract ZM files:
cd /root
wget http://www2.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz
wget http://www.zoneminder.com/fileadmin/downloads/cambozola.jar
tar -zxvf ZoneMinder-1.24.2.tar.gz
cd ZoneMinder-1.24.2

11) Install
CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=yourpassword
make
make install

12) MySQL Preparation:
mysql -u root -p
create database zm;
grant all on zm.* to zmuser@localhost identified by 'yourpassword';
flush privileges;
exit

13) Import the Database:
cd /root/ZoneMinder-1.24.2
mysql -u root -p zm < db/zm_create.sql

14) Finale
cp scripts/zm /etc/init.d/
chmod +x /etc/init.d/zm
chkconfig zm on
cd ..
cp cambozola.jar /var/www/html/zm/
chown apache:apache /var/www/html/zm/cambozola.jar
service zm start

--

and you're done! kindly check the wiki / documentation for option properties. adding cams, adjusting this and such..

Mark

3 comments:

  1. In step 10, the following command gives a 404 error:

    wget http://www.zoneminder.com/fileadmin/downloads/cambozola.jar

    The command below worked for me based on the link from ZoneMinder's download page.

    wget http://www.zoneminder.com/sites/zoneminder.com/downloads/cambozola.jar

    Thanks for posting this helpful step-by-step guide to setting up ZoneMinder!

    ReplyDelete
  2. Excellent!
    Been using ZM on Ubuntu for a bit but wanted to install alongside my PBX which has to be Centos. Your guide was a cut-and-paste breeze.

    Only hitch I ran into was my httpd server runs under the asterisk id so I had to change permissions on the zm.conf file.

    Thanks for your time,
    AhCiIi

    ReplyDelete
  3. Very handy guide. Only update for Zoneminder 1.24.4 on Centos 5.6 is that you need to run zm through dos2unix.

    cd /etc/init.d/
    dos2unix -k zm

    Does the job if you've already copied the scripts as per your guide above.

    service zm start then works ...

    ReplyDelete