ZoneMinder

ZoneMinder Capture, analyse, record and monitor any cameras attached to your system.

Dependencies

 * Apache 2: www-servers/apache
 * MySQL: dev-db/mariadb
 * PHP: dev-lang/php

USE flags
Enable the following USE flags for and :

Emerge
Install ZoneMinder:

Apache

 * Select correct version of PHP


 * Edit /etc/php/apache2-php5.6/php.ini to reflect:


 * Edit /etc/conf.d/apache2 and add "-D PHP -D PROXY" to APACHE2_OPTS


 * Remove Apache startup warning: "...fully qualified domain name..."


 * Create /etc/apache2/vhosts.d/10_zoneminder.conf and add the following:

MySQL

 * Create ZoneMinder's database, zm, as a standard user


 * Import the database schema and base data, the .sql script is created by the configure phase above, so make sure you do that first.


 * Create a MySQL user for ZM to use. If you change the user and/or password from the defaults here, then make sure you set those in the source configure phase.

ZoneMinder

 * Edit /etc/zm.conf and add the above MySQL database username and password:

OpenRC
Start the Apache server:

Add Apache to the default runlevel:

Reload the Apache configuration files:

Start PHP server:

Add PHP to the default runlevel:

Start MySQL server:

Add MySQL to the default runlevel:

Start ZoneMinder server:

Add ZoneMinder to the default runlevel:

systemd
Start the Apache server:

Add Apache to startup:

Start the PHP server:

Add PHP to startup:

Start the MySQL server:

Add MySQL to startup:

Start the ZoneMinder server:

Add ZoneMinder to startup:

Selinux
If you are using selinux you must create a policy. Hopefully later when the ebuild comes back this will be done automatically.

Make local_zoneminder.te

Now it's time to build the modules.

Other
Shared memory: sysctl kernel.shmmax=536870912