Code: Select all
#!/bin/bash
# This is the Zoneminder install for Centos 6.2
# Put this in /root, and extract ZoneMinder, Cambozola & FFmpeg 0.6.5 in /root
# CHANGE THESE!
DBUSER='zm'
DBZMPASS='zmpass'
DBROOTPASS='rootpass'
# Update all the CentOS files and get required packages
/usr/bin/yum -y check-update
/usr/bin/yum -y update
# Add the rpmforge release from the Centos Wiki here!!!!!!!!!!!!!!
########### REMOVED
/usr/bin/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 perl-CPAN
/usr/bin/yes | /usr/bin/cpan -fi LWP::UserAgent
/usr/bin/yum -y install libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools \
perl-Date-Manip perl-LWP-UserAgent-Determined
/usr/bin/yum -y install perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap \
perl-Module-Load subversion git yasm
/usr/bin/yum -y groupinstall core
/usr/bin/yum -y groupinstall base
/usr/bin/yum -y install gcc gcc-c++ wget bison mysql-devel mysql-server php php-mysql php-pear php-pear-DB php-mbstring \
nano 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 nano kernel-devel \
bison-devel ncurses zlib zlib-devel openssl openssl-devel gnutls-devel php-process perl-Time-HiRes
cd /root/ffmpeg-0.6.5
./configure --enable-gpl --enable-shared --enable-pthreads
/usr/bin/make
/usr/bin/make install
/usr/bin/make install-libs
# edit /etc/ld.so.conf and add the line "/usr/local/lib"
/bin/echo "/usr/local/lib" >> /etc/ld.so.conf
/sbin/ldconfig
/sbin/chkconfig httpd on
/sbin/chkconfig mysqld on
/sbin/chkconfig ntpd on
/sbin/service httpd start
/sbin/service mysqld start
/sbin/service ntpd start
cd /root/ZoneMinder-1.25.0
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=$DBUSER ZM_DB_PASS=$DBZMPASS ZM_SSL_LIB=openssl
/usr/bin/make
/usr/bin/make install
/usr/bin/mysql -e "SET PASSWORD FOR root@localhost=PASSWORD('$DBROOTPASS')"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "DROP DATABASE IF EXISTS zm"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "CREATE DATABASE zm"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "DROP USER '$DBUSER'@'localhost'"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "CREATE USER '$DBUSER'@'localhost'"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "SET PASSWORD FOR $DBUSER@localhost=PASSWORD('$DBZMPASS')"
/usr/bin/mysql -uroot -p$DBROOTPASS -e "GRANT CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to $DBUSER@localhost"
/usr/bin/mysql -uroot -p$DBROOTPASS zm < db/zm_create.sql
/bin/cp scripts/zm /etc/init.d/
/bin/chmod +x /etc/init.d/zm
/sbin/chkconfig zm on
cd /root
/bin/cp cambozola.jar /var/www/html/zm/
/bin/chown apache:apache /var/www/html/zm/cambozola.jar
/sbin/service zm restart
echo "Stuff to do:"
echo "Set short_open_tag = On in /etc/php.ini!"
echo "Turn off or configure selinux"
echo "Configure IPTables"
echo "Turn on camboloza option in ZM, options->image"