Ubuntu 7.10 server/ZM 1.23.2 from src, how to (31/03/2008)
Posted: Thu Jan 24, 2008 12:34 am
UPDATE: 05/02/2008
Solved autostart and add apache2 configuration
UPDATE: 07/02/2008
Solved NTP/Timezone issues
UPDATE: 10/03/2008
SOLVED FFMPEG issue (step 17)
UPDATE: 12/03/2008
Change from ZM 1.23.1 to 1.23.2
UPDATE: 31/03/2008
Update FFMPEG compile instructions to fix changes in most recent versions from SVN
Hello!
I've been experiencing with ZoneMinder for some time now.
My first install was with zoneminder_1.22.3-10_i386.deb and it worked better than I was expecting.
Now, I want to try 1.23.2 and since no package available, I decided to reinstall everything from source.
I'm not an expert in linux and my setup still has some problems as I'll describe in the end.
So let's start:
1.Install Ubutu 7.10 Server 32bits without no extra options
2. Install ssh to allow remote access and set network card static IP.
3. edit the hosts file
4. Add additional repositories, update and reboot
5. Install several packages needed
6. Configure my PICO2000 4 inputs video card
7. Install Munim for remote server stats
8. We have to set the PHP timezone to our current timezone and provide a more suitable server for NTP service
9. Install FFMPEG from SVN
10. Add PHP Serialization
11. Download ZM and build it
12. Some additional settings
13. Shared memory settings
14. Install Cabonzola and Mootools (from my local machine)
15. Start ZoneMinder
16. Configure mysql to allow other machines on my network to access using ZM4MS
17. Edit zmvideo.pl to solve ffmpeg error: "Video generation failed!"
After this, the system is running very well except:
- With the DVR style streaming enabled I can't edit Zones (BUG)
I hope this post help Ubuntu crew.
Best regards.
Solved autostart and add apache2 configuration
UPDATE: 07/02/2008
Solved NTP/Timezone issues
UPDATE: 10/03/2008
SOLVED FFMPEG issue (step 17)
UPDATE: 12/03/2008
Change from ZM 1.23.1 to 1.23.2
UPDATE: 31/03/2008
Update FFMPEG compile instructions to fix changes in most recent versions from SVN
Hello!
I've been experiencing with ZoneMinder for some time now.
My first install was with zoneminder_1.22.3-10_i386.deb and it worked better than I was expecting.
Now, I want to try 1.23.2 and since no package available, I decided to reinstall everything from source.
I'm not an expert in linux and my setup still has some problems as I'll describe in the end.
So let's start:
1.Install Ubutu 7.10 Server 32bits without no extra options
2. Install ssh to allow remote access and set network card static IP.
Code: Select all
sudo apt-get install ssh
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.90
netmask 255.255.255.0
gateway 192.168.2.1
Code: Select all
sudo nano /etc/hosts
192.168.2.90 computer.domain.pt dvr
Code: Select all
sudo nano /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade
sudo reboot
5. Install several packages needed
Code: Select all
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server libmysqlclient15-dev
sudo apt-get install libarchive-tar-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl
sudo apt-get install libjpeg62 libjpeg62-dev libmime-perl libstdc++6 libwww-perl zlib1g
sudo apt-get install zip unzip patch ntp openssl libpcre3-dev libssl-dev libjpeg-progs
sudo apt-get install build-essential subversion libcurl4-gnutls-dev
Code: Select all
modprobe bttv
lsmod
dmesg | grep bttv
sudo nano /etc/modprobe.d/devfsd
alias char-major-81 videodev
alias char-major-81-0 bttv
options bttv card=77 tuner=-1 radio=0 triton1=0 vsfx=0 autoload=0
sudo reboot
lsmod
dmesg | grep bttv
Code: Select all
sudo apt-get install munin munin-node
Code: Select all
sudo nano /etc/php5 /apache2/php.ini
date.timezone = Europe/Lisbon
sudo nano /etc/ntp.conf
server europe.pool.ntp.org
Code: Select all
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
. ./configure --enable-shared --enable-postproc --enable-swscale --enable-gpl --prefix=/opt/
make
sudo make install
Code: Select all
sudo perl -MCPAN -e shell
install PHP::Serialization
exit
Code: Select all
wget http://www.zoneminder.com/downloads/ZoneMinder-1.23.2.tar.gz
tar zxvf ZoneMinder-1.23.2.tar.gz
cd ZoneMinder-1.23.2
./configure --with-webdir=/var/www/html/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --with-ffmpeg=/opt
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';
quit
mysqladmin -u root -p reload
sudo make install
cd ..
sudo nano /etc/init.d/zm
#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 35 15
# 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: "
$ZM_PATH_BIN/zmfix –a
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
echo
[ $RETVAL = 0 ] && touch /var/lock/zm
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
#
# Why is this status check being done?
# as $command stop returns 1 if zoneminder
# is stopped, which will result in
# this returning 1, which will stuff
# dpkg when it tries to stop zoneminder before
# uninstalling . . .
#
result=`$command status`
if [ ! "$result" = "running" ]; then
echo "Zoneminder already stopped"
echo
RETVAL=0
else
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
echo
[ $RETVAL = 0 ] && rm -f /var/lock/zm
fi
}
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' | 'force-reload')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
# end of file
sudo chmod 755 /etc/init.d/zm
sudo chmod +x /etc/init.d/zm
sudo update-rc.d zm defaults
sudo /etc/init.d/zm restart
sudo touch /var/www/index.html
sudo nano /etc/apache2/conf.d/zoneminder.conf
Alias /zm /var/www/html/zm
<Directory>
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule>
DirectoryIndex index.php
</IfModule>
</Directory>
sudo /etc/init.d/apache2 force-reload
Code: Select all
sudo adduser www-data video
sudo chmod 666 /dev/video0
sudo chmod 4755 /usr/local/bin/zmfix
zmfix -a
sudo chown www-data.www-data /var/www/html/zm/temp
Code: Select all
sudo nano /etc/sysctl.conf
kernel.shmall = 134217728
kernel.shmmax = 134217728
Code: Select all
wget http://www.charliemouse.com/code/cambozola/cambozola-latest.zip
unzip cambozola-latest.zip
sudo cp cambozola-0.68/dist/* /var/www/html/zm/
wget http://192.168.2.101/mootools-release-1.11.js
sudo cp mootools-release-1.11.js /var/www/html/zm/mootools.js
Code: Select all
sudo zmpkg.pl start
Code: Select all
sudo vi /etc/mysql/my.cnf
# bind-address 127.0.0.1
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.2.%' IDENTIFIED BY '*****' WITH GRANT OPTION;
quit
sudo /etc/init.d/mysql restart
Code: Select all
sudo nano /usr/bin/zmvideo.pl
(remove the ‘&’ at line 323 to fix zmvideo.pl problem near the end)
- With the DVR style streaming enabled I can't edit Zones (BUG)
I hope this post help Ubuntu crew.
Best regards.