yadig? yet another debian install guide

Support and queries relating to all previous versions of ZoneMinder
Locked
jan
Posts: 17
Joined: Sat May 20, 2006 7:55 am
Location: europe

yadig? yet another debian install guide

Post by jan »

hi,
here is how I install zm on debian. I like to keep things simple (using default stable versions of apache/mysql/php) and compile the latest ZM without ffmpeg.


1. install debian usings defaults, without software packages
to use the 2.6 kernel (recommended for bttv cards) type in linux26 at the cd-boot prompt.
use expert26 for a more verbose 2.6 kernel install, or expert24 for a verbose 2.4 kernel install
debian installation manual if needed: http://www.debian.org/releases/stable/installmanual


2. login as root and install apache 1.3, mysql server 4.0, php 4.3, required libraries...

Code: Select all

debian:~# apt-get install apache mysql-server libmysqlclient12-dev php4 php4-mysql g++ make netpbm libssl-dev libjpeg62-dev libmime-perl libwww-perl libarchive-tar-perl libdate-manip-perl libarchive-zip-perl libmime-lite-perl libdbi-perl libdbd-mysql-perl libpcre3-dev
3. increase shared memory and reboot

Code: Select all

debian:~# echo kernel.shmmax = 134217728 >> /etc/sysctl.conf
debian:~# reboot
4. download, extract, configure zoneminder, import sql structure, create zmuser, compile...

Code: Select all

debian:~# wget http://www2.zoneminder.com/downloads/ZoneMinder-1.22.1.tar.gz
debian:~# tar -xvzf ZoneMinder-1.22.1.tar.gz
debian:~# cd ZoneMinder-1.22.1
debian:~/ZoneMinder-1.22.1# ./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data
debian:~/ZoneMinder-1.22.1# mysql mysql < db/zm_create.sql
debian:~/ZoneMinder-1.22.1# mysql mysql
mysql> grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
mysql> quit
debian:~/ZoneMinder-1.22.1# mysqladmin reload
debian:~/ZoneMinder-1.22.1# make install
5. connect to http://debian/zm and change these options...
System/ZM_AUTH_RELAY - none
Paths/ZM_PATH_ZMS - /cgi-bin/zms


---optional security settings---

6. turn on System/ZM_OPT_USE_AUTH and change the admin password

7. change mysql root password

Code: Select all

debian:~# mysqladmin -u root password 'passwordyouwant'
8. install and configure a network time protocol client

Code: Select all

debian:~# apt-get install ntpdate
debian:~# echo NTPSERVERS="pool.ntp.org" >> /etc/default/ntpdate
9. install and configure a firewall to only allow incoming http

Code: Select all

debian:~# apt-get install firehol
debian:~# firehol-wizard
Last edited by jan on Sat May 20, 2006 12:19 pm, edited 1 time in total.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

hopefully this will help the debian people thanks!
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This is just the sort of thing that I think would be great in the new Wiki. Please feel free to add it there as well.
Phil
jan
Posts: 17
Joined: Sat May 20, 2006 7:55 am
Location: europe

Post by jan »

ok I've put it on http://www.zoneminder.com/wiki/index.php/Debian

when i was doing an install a few weeks ago i didn't find a list of debian packages required by zm, like i had found when i did my first install (2 years ago?), so when I finally found the right mix of packages I thought I'd post it. I haven't actually tried to follow that guide so I hope I didn't miss anything.

jan
RhettNyeDotOrg
Posts: 6
Joined: Fri May 12, 2006 9:35 pm

Post by RhettNyeDotOrg »

Thanks for this Debian how-to, it's awesome. What timing for your post, I dug in to the project yesterday and after some problems with the mandriva 2006 zm image, I went back to Debian and found your post right away. I'm using Apache2 and the libssl-dev in your apt-get line was what i was missing to get it to configure for me. I'm up and running, but just have to get my cams to work now. I have a USB webcam, a USB capture device and a bttv pci device. Wish me luck!

One question, i couldn't find much info on your suggestion to change the shared memory ( kernel.shmax = ##########) I have a weak system, PII 350, with like 768 MB Ram, and a 6GB HDD. What would you suggest for ########## in this case, or can you provide a link that will explain this shared memory (i tried googling but couldn't find anything satisfactory)

Also, would you not suggest that the Debian system we install on, also include an X-Windows installation, and perhaps XawTV to get the cams up and running first?

Thanks again!

Cheers
sawireless2000
Posts: 5
Joined: Sun Jan 22, 2006 4:39 pm

Post by sawireless2000 »

zoneminder wrote:This is just the sort of thing that I think would be great in the new Wiki. Please feel free to add it there as well.
Added this thread's link to
http://www.zoneminder.com/wiki/index.ph ... uild_notes
jan
Posts: 17
Joined: Sat May 20, 2006 7:55 am
Location: europe

Post by jan »

RhettNyeDotOrg wrote: One question, i couldn't find much info on your suggestion to change the shared memory ( kernel.shmax = ##########) I have a weak system, PII 350, with like 768 MB Ram, and a 6GB HDD. What would you suggest for ########## in this case, or can you provide a link that will explain this shared memory (i tried googling but couldn't find anything satisfactory)
with that much ram, the number provided (128mb) shouldn't cause any problems...

the minimum amount of shared memory you should allocate depends on "the following formula: ring buffer size x image width x image height x 3 (for 24 bits images) + a bit of overhead. So if for instance you were using 24bit 640x480 then this would come to about 92Mb if you are using the default buffer size of 100. If this is too large then you can either reduce the image or buffer sizes or increase the maximum amount of shared memory available." -from the README
RhettNyeDotOrg wrote: Also, would you not suggest that the Debian system we install on, also include an X-Windows installation, and perhaps XawTV to get the cams up and running first?
I don't run X on any of my installs, but you can certainly install it if you're having trouble getting the cams to work...and then turn it off by switching to runlevel 3...if you want to use X on that machine regularly, xfce4 might be a good choice at 350mhz
RhettNyeDotOrg
Posts: 6
Joined: Fri May 12, 2006 9:35 pm

Post by RhettNyeDotOrg »

yeah in the readme file. thanks for your trouble. :oops: :roll: :lol:
majik-br
Posts: 17
Joined: Mon Sep 19, 2005 12:46 pm
Location: Sao Paulo, Brazil

Post by majik-br »

hey jan thanks for this nice guide.

I've already used it a couple times and it's by far the easiest way to set up a zm system in less than 20 minutes. Reading this guide using lynx is the worst part! :P

And of course ... Debian - should you build any security system using other distro than that? I should say only Slackware for the hardcore but apt-get rocks.

thx!
Locked