zoneminder/distros/ubuntu1504_cmake
Isaac Connor f4debc203d Only run zmupdate.pl if the mysql db is located here 2015-12-20 12:23:40 -05:00
..
conf/apache2 set AllowOverride All for api dir 2015-08-19 16:08:48 -04:00
examples This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
patches don't need apache patch anymore 2015-09-14 14:36:19 -04:00
source change format to native, which makes building packages so much easier 2015-10-30 12:19:12 -04:00
NEWS This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
README.Debian add index to recommended default permissions on zmuser 2015-11-20 16:00:57 -05:00
TODO.Debian This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
changelog This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
clean This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
compat This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
control This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
copyright This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
gbp.conf This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
libzoneminder-perl.install This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
rules This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
watch This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder-doc.doc-base This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder-doc.install This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder-doc.links This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.apache2 This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.bug-presubj This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.dirs This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.docs This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.examples This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.init Setting the TZ ENV variable prevents every gettimeofday call from reading /etc/timezone 2015-10-01 11:47:12 -04:00
zoneminder.install This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.links This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.linktrees This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.lintian-overrides This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.logrotate This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.maintscript This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.manpages This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.postinst Only run zmupdate.pl if the mysql db is located here 2015-12-20 12:23:40 -05:00
zoneminder.postrm This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.preinst need to check the case of having a / at the end 2015-09-14 14:55:37 -04:00
zoneminder.service This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00
zoneminder.tmpfile This will be used from now on when generating master snapshots for ubuntu1504 for a single zoneminder.deb 2015-08-17 14:03:27 -04:00

README.Debian

Zoneminder for Debian
---------------------

Initializing database
---------------------

    pv /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf
OR
    cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf

    echo 'grant lock tables,alter,create,index,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";'\
    | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql

Hint: generate secure password with `pwgen` and update "/etc/zm/zm.conf"
accordingly.

The following command can help to ensure that zoneminder can read its
configuration file:

    chgrp -c www-data /etc/zm/zm.conf


Upgrading database
------------------

Prior to 1.28.1 database upgrade was performed automatically.
"zoneminder" service will refuse to start with outdated database.

Assuming that database is on "localhost" then the following command can be
used to upgrade "zm" database:

    zmupdate.pl

Additional permissions may be required to perform upgrade:

    echo 'grant lock tables, create, alter on zm.* to 'zmuser'@localhost identified by "zmpass";'\
    | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql

The following command prints the current version of zoneminder database:

    echo 'select Value from Config where Name = "ZM_DYN_CURR_VERSION";' \
    | sudo mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names zm


Enabling service
----------------

By default Zoneminder service is not starting automatically and need to be
manually activated once database is configured:

On systemd:

    sudo systemctl enable zoneminder.service

On SysV:

    sudo update-rc.d zoneminder enable


Web server set-up
-----------------

There are few manual steps to get the web interface working:

## Apache2

Apache can be configured as folder "/zm" using sample .conf:

    sudo a2enconf zoneminder

Alternatively Apache web site configuration template can be used to setup
zoneminder as "http://zoneminder":

    sudo cp -v /usr/share/doc/zoneminder/examples/apache.conf /etc/apache2/sites-available/
    sudo a2ensite zoneminder.conf

Common configuration steps for Apache2:

    sudo a2enmod cgi
    sudo service apache2 reload


## nginx / fcgiwrap

Nginx needs "php5-fpm" package to support PHP and "fcgiwrap" package
for binary "cgi-bin" applications:

    sudo apt-get install php5-fpm fcgiwrap

To enable a URL alias that makes Zoneminder available from

    http://yourserver/zm

the following line is to be added to "server" section of a web site
configuration:

    include /usr/share/doc/zoneminder/examples/nginx.conf;

For "default" web site it would be sufficient to include the above
statement to the file

    /etc/nginx/sites-enabled/default

To avoid problems with feeds from multiple cameras "fcgiwrap" should be
configured to start at least as many processes as there are cameras.
It can be done by adjusting DAEMON_OPTS in "/etc/default/fcgiwrap".
Systemd users may be affected by the following bug:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792705


## Note:

When Zoneminder web site is running it may be necessary to set
Options/Paths/PATH_ZMS to "/zm/cgi-bin/nph-zms" or according to chosen web
site configuration.


Changing the location for images and events
-------------------------------------------

Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/.  This
package modifies that by changing /usr/share/zoneminder/images and
/usr/share/zoneminder/events to symlinks to directories under
/var/cache/zoneminder.

There are numerous places these could be put and ways to do it.  But, at the
moment, if you change this, an upgrade will fail with a warning about these
locations having changed (the reason for this was that previously, an  upgrade
would silently revert the changes and cause event loss - refer
bug #608793).

If you do want to change the location, here are a couple of suggestions.
(thanks to vagrant@freegeek.org):

These lines in fstab could allow you to bind-mount an alternate location

         /dev/sdX1 /otherdrive ext3 defaults 0 2
         /otherdrive/zoneminder/images /var/cache/zoneminder/images bind defaults 0 2
         /otherdrive/zoneminder/events /var/cache/zoneminder/events bind defaults 0 2

        or if you have a separate partition for each:

         /dev/sdX1 /var/cache/zoneminder/images ext3 defaults 0 2
         /dev/sdX2 /var/cache/zoneminder/events ext3 defaults 0 2

 -- Peter Howard <pjh@northern-ridge.com.au>, Sun, 16 Jan 2010 01:35:51 +1100

Access to /dev/video*
---------------------

For cameras which require access to /dev/video*, zoneminder may need the
www-data user added to the video group in order to see those cameras:

  adduser www-data video

Note that all web applications running on the zoneminder server will then have
access to all video devices on the system.

 -- Vagrant Cascadian <vagrant@debian.org>  Sun, 27 Mar 2011 13:06:56 -0700