Zoneminder installation on Debian Lenny
This is an *new* installation instruction for Zoneminder on Debian Lenny, additional to this one.
The installation path "/var/www/zoneminder" (web-directory / webdir) is assumed.

First, install some required software components, assuming Apache2, PHP and MySql are already installed:
apt-get install gcc make ffmpeg c++ g++ libmysqlclient15-dev libjpeg62 libjpeg62-dev openssl libapache2-mod-gnutls libcrypt-openssl-bignum-perl libgnutls26 libgnutls-dev libcgi-untaint-date-perl liblwp-useragent-determined-perl libphp-serialization-perl libssl-dev

Get newest Zoneminder Version:
tar -xzf ZoneMinder-1.24.2.tar.gz
cd ZoneMinder-1.24.2

Create an executable file "cfgscript" with the following content and change parameters to fit your environment:
make clean


Configure, Compile and (if no errors occur) install:
make check
make install

You maybe have to copy zm.conf manually to its dir:
cp zm.conf /usr/local/etc/

After creating Zoneminder MySql user/database, fill it with the zm data:
mysql zm < db/zm_create.sql
(You may need to supply a username and password to the mysql commands in the first place to give yourself sufficient privileges to perform the required commands. To do that it's something like: mysql -uroot -p<root database password> zm.)
In other wods, it might look like the following:
mysql -u zoneminder -p zoneminder < db/zm_create.sql

Create Apache config file, e.g. /etc/apache2/conf.d/zoneminder:
<Directory /var/www/zoneminder/cgi-bin/>
    AllowOverride None
    SetHandler cgi-script
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all

Make sure that Apache2 runs as the same user as you chose for zoneminder (check here: /etc/apache2/envvars):
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/

In Zoneminder webinterface (, make sure that under "Options > Paths > PATH_ZMS", the correct path is given. For me, "/zoneminder/cgi-bin/nph-zms" was fine.

Shared Memory

With ipcs -l, you can see something like this:
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 1007
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

And with ipcs -m:
------ Shared Memory Segments --------
key    shmid   owner   perms   bytes   nattch   status
0x7a6d0001 131072   username  700    9217192  0
0x7a6d0002 163841   username  700    9217192  1
0x7a6d0003 196610   username  700    9217192  1

If you see "Can't get shared memory id ..." in "/tmp/zmwatch.log, do this:
Open the file "/etc/sysctl.conf", and paste this 2 line at the bottom of the file:
# Increase the maximum shared memory
kernel.shmmax = 167772160

admin / Nov 02, 2009
2004 - 2021 /