Project

General

Profile

Support #627

Install Zoneminder on Arch

Added by Daniel Curtis over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Camera Server
Target version:
Start date:
06/11/2015
Due date:
% Done:

100%

Estimated time:
6.00 h
Spent time:

Description

This is a guide for installing Zoneminder on Arch Linux.

Prepare the Environment

  • Make sure the system is up to date:
    pacman -Syu
    

Install yaourt

Install Zoneminder

  • Install zoneminder from the AUR:
    yaourt zoneminder
    

Configure Apache

  • Edit the apache config:
    nano /etc/httpd/conf/httpd.conf
    
    • And add/modify the following to ensure PHP, prefork and cgi are enabled:
      #LoadModule mpm_event_module modules/mod_mpm_event.so
      LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
      LoadModule php5_module modules/libphp5.so
      LoadModule cgi_module modules/mod_cgi.so
      
  • Append the Zoneminder inclusion to the apache config:
    echo 'Include conf/extra/php5_module.conf' >> /etc/httpd/conf/httpd.conf
    echo 'Include /etc/httpd/conf/extra/httpd-zoneminder.conf' >> /etc/httpd/conf/httpd.conf
    
    • NOTE: I needed to comment out the php_admin_value in httpd-zoneminder.conf file.

Configure PHP

  • Edit the PHP configuration:
    nano /etc/php/php.ini
    
    • Ensure the following extensions are enabled:
      extension=pdo_mysql.so
      extension=gd.so
      extension=gettext.so
      extension=mcrypt.so
      extension=sockets.so
      extension=openssl.so
      extension=ftp.so
      
    • Ensure open_basedir has the following directories added/included:
      open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/dev/:/etc:/srv/http/zoneminder:/srv/zoneminder/:/var/cache/zoneminder/
      
    • Set the local timezone:
      date.timezone = America/Los_Angeles
      

Initialize MySQL

  • Initialize the MySQL database:
    cd /usr
    mysql_install_db --user=mysql --ldata=/var/lib/mysql/
    
  • Start and enable MySQL on boot:
    systemctl enable mysqld
    systemctl start mysqld
    
  • Secure the installation:
    mysql_secure_installation
    
  • Import the zoneminder SQL data:
    mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f reload
    cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf -p
    
  • Set permissions on the zm database for the user zmuser with the password zoneminder
    echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zoneminder";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql
    
  • Edit the zoneminder config
    nano /etc/zm.conf
    
    • And update the host, database, username, and/or password:
      ZM_DB_HOST=localhost
      ZM_DB_NAME=zm
      ZM_DB_USER=zmuser
      ZM_DB_PASS=zoneminder
      

Start Zoneminder

  • Start and enable Apache on boot:
    systemctl enable httpd
    systemctl start httpd
    
  • Start and enable zoneminder on boot:
    systemctl enable zoneminder
    systemctl start zoneminder
    

Resources

Also available in: Atom PDF