User talk:MalakymR/draft/ZoneMinder

From ZoneMinder Wiki
Jump to navigationJump to search

Installing ZoneMinder for Gentoo

There are ZoneMinder packages (called 'ebuilds') available for Gentoo in the 'portage' tree. https://packages.gentoo.org/packages/www-misc/zoneminder

The ZoneMinder ebuilds (as of Jan 2019) are out of date. To get up to date versions including a live git version add the mkr-overlay.

emerge -a layman
layman -a mkr-overlay (Note: pending addition to gentoo's overlay repo list - can be added directly to local repo list if needed)

If you want the latest RELEASE then simply emerge zoneminder.

emerge --ask zoneminder

If you want to run from git master then specify the 9999 ebuild that downloads live from github.

emerge --ask =zoneminder:9999


Note: 9999 will not update with emerge update commands and needs to rerun as and when. Running live git versions is risky and requires reading change note for breaking system changes.

This should pull in apache, php and mariadb/mysql as required.

Apache still needs setting up to use PHP if you haven't already done it. /etc/conf.d/apache2

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP -D PROXY"


ZoneMinder currently depends on mysql. Gentoo will install dev-db/maria by default unless you configure otherwise. This will need to be configured prior to running ZoneMinder and adding its database.

emerge --config mariadb

Once configured, you will need to add the zm database and install the default tables.

mysql -uroot -p -e "create database zm;"
mysql -uroot -p zm < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p

mysql> use zm; grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';
mysql> flush privileges;
mysql> exit;


Config File

ZoneMinder's config file is located at /etc/zm/zm.conf though this is not meant to be changed.

Create your own /etc/zm/conf.d/03-custom.conf with your new settings

A default install will only require your database details to be updated.

ZM_DB_USER=zmuser
ZM_DB_PASS=zmpass


There is an example apache2 vhost config that can simply be extracted and normally works for all situations.

bzcat /usr/share/doc/zoneminder-*/10_zoneminder.conf.bz2 > /etc/apache2/vhosts.d/10_zoneminder.conf

This sets ZM up in a /zm sub directory. (Note: work needs to be done here to default it to / and vhost this dir via a single alias or hostname)