Install fresh Centos 6.0 64-bit to box. REMEMBER config nic when you install.
Reboot box after install. Logon with root and then do everything with root too.
Install required packages, other useful packages, and their dependencies:
Code: Select all
yum -y update
Code: Select all
yum -y groupinstall core
Code: Select all
yum -y groupinstall base
Code: Select all
wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Code: Select all
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
Code: Select all
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
Code: Select all
yum -y update
Code: Select all
yum install -y gcc gcc-c++ bison mysql-devel mysql-server php php-mysql php-pear php-pear-DB php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel php-gd audiofile-devel gtk2-devel subversion kernel-devel bison-devel zlib-devel openssl-devel gnutls-devel php-process perl-Time-HiRes pcre-devel gd mod_ssl ImageMagick libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools perl-Date-Manip perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap perl-Module-Load git yasm cpan mc htop
Code: Select all
cpan -i LWP::UserAgent
Install bttv driver- follow this step only if your card is not detected:
My card like this: http://www.zoneminder.com/wiki/index.php/Kodicom_8800
Code: Select all
nano /etc/modprobe.d/bttv.conf
After editing in nano, hit ctrl-o to save, hit enter to use the given name, then hit ctrl-x to exit nanooptions i2c-algo-bit bit_test=1
options bttv gbuffers=16 card=102,102,102,102,102,102,102,102 radio=0,0,0,0,0,0,0,0 tuner=4,4,4,4,4,4,4,4 chroma_agc=1 combfilter=2 full_luma_range=1 coring=1 autoload=0
Disabled firewall:
Code: Select all
setup
Disabled SELINUX:
Code: Select all
nano /etc/selinux/config
After editing in nano, hit ctrl-o to save, hit enter to use the given name, then hit ctrl-x to exit nano
Install ffmpeg:
Code: Select all
git clone git://git.videolan.org/ffmpeg.git
Code: Select all
cd ffmpeg && ./configure --enable-gpl --enable-shared --enable-pthreads
Code: Select all
make
Code: Select all
make install
Code: Select all
make install-libs
Code: Select all
cd /lib && ln -s /usr/local/lib/libswscale.so.0 && ln -s /usr/local/lib/libswresample.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 && ln -s /usr/local/lib/libavdevice.so.53 && ln -s /usr/local/lib/libavfilter.so.2 && ln -s /usr/local/lib/libavformat.so.53 && ln -s /usr/local/lib/libavcodec.so.53 && ln -s /usr/local/lib/libpostproc.so.51 && ln -s /usr/local/lib/libswscale.so.2 && ln -s /usr/local/lib/libavutil.so.51
ldconfig
Code: Select all
cd && wget http://sourceforge.net/projects/libjpeg-turbo/files/1.1.1/libjpeg-turbo-1.1.1.x86_64.rpm/download
Code: Select all
rpm -i libjpeg-turbo-1.1.1.x86_64.rpm && nano /etc/ld.so.conf.d/libjpeg-turbo.conf
After editing in nano, hit ctrl-o to save, hit enter to use the given name, then hit ctrl-x to exit nano/opt/libjpeg-turbo/lib64
Code: Select all
ldconfig
Code: Select all
chkconfig httpd on
chkconfig mysqld on
chkconfig ntpd on
service httpd start
service mysqld start
service ntpd start
Code: Select all
cd && wget http://www2.zoneminder.com/downloads/ZoneMinder-1.25.0.tar.gz
Code: Select all
tar -zxvf ZoneMinder-1.25.0.tar.gz && cd ZoneMinder-1.25.0
Code: Select all
CFLAGS="-g -O3 -march=native -mtune=native" CXXFLAGS="-D__STDC_CONSTANT_MACROS -g -O3 -march=native -mtune=native" ./configure --with-extralibs="-L/usr/lib64 -L/usr/lib64/mysql" --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=zmpass ZM_SSL_LIB=openssl
Code: Select all
make
Code: Select all
make install
Need to add a password for the root user of MySQL (in my case password is: 111111)
Create the zm database
Create the zm database user with permissions and password
Code: Select all
mysql
Code: Select all
SET PASSWORD FOR root@localhost=PASSWORD('111111');
Code: Select all
create database zm;
Code: Select all
CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
Code: Select all
grant CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to zmuser@localhost;
Code: Select all
exit
Import the tables into the zm database
Code: Select all
mysql -u root -p zm < db/zm_create.sql
Make it so that ZoneMinder will startup automatically when the system is rebooted
Code: Select all
cp scripts/zm /etc/init.d/
chmod +x /etc/init.d/zm
chkconfig zm on
Code: Select all
cd && wget http://www.zoneminder.com/sites/zoneminder.com/downloads/cambozola.jar
Code: Select all
cp cambozola.jar /var/www/html/zm/
Code: Select all
chown apache:apache /var/www/html/zm/cambozola.jar
Code: Select all
mcedit /usr/local/bin/zmdc.pl
Click F2 to save, click F10 to quit.foreach my $arg ( @ARGV )
}
}
+# Create the directory first if it doesn't exist
+mkdir(ZM_PATH_SOCKS);
+
socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" );
my $saddr = sockaddr_un( SOCK_FILE );
To be sure, add rights to the /tmp/zm directory
Code: Select all
chown apache:apache -R /tmp/zm
Code: Select all
mcedit /etc/php.ini
to:;date.timezone =
And change from:date.timezone = Asia/Ho_Chi_Minh
to:short_open_tag = Off
Click F2 to save, click F10 to quit.short_open_tag = On
Reboot box:
Code: Select all
reboot
If you want better quality video, cut -r 25 in Option->Images->FFMPEG_OUTPUT_OPTIONS ad replace with:
To check libjpeg-turbo works:-f mp4 -r 25 -b 2048k -vcodec mpeg4
Code: Select all
lsof |grep libjpeg.so.62.0.0
Have fun.[root@dvr ~]# lsof |grep libjpeg.so.62.0.0
httpd 1672 root mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1850 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1851 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1852 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1853 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1854 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1855 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1856 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
httpd 1857 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 1888 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 1899 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 1960 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 1971 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 1996 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2007 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 2032 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2043 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 2070 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2081 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 2106 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2117 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 2142 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2153 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zmc 2178 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0
zma 2189 apache mem REG 8,1 258704 6160404 /opt/libjpeg-turbo/lib64/libjpeg.so.62.0.0