Support #627
Updated by Daniel Curtis over 8 years ago
{{>toc}} This is a guide for installing Zoneminder on Arch Linux. h2. Prepare the Environment * Make sure the system is up to date: <pre> pacman -Syu </pre> h3. Install yaourt * Download the packages for yaourt: <pre> cd /tmp wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz && wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz tar xzf package-query.tar.gz tar xzf yaourt.tar.gz </pre> #* Install "yaourt":https://project.altservice.com/issues/509 package-query: <pre> cd package-query makepkg -csi </pre> #* Install yaourt <pre> cd ../yaourt makepkg -csi </pre> h2. Install Zoneminder * Install zoneminder from the AUR: <pre> yaourt zoneminder </pre> h3. Configure Apache * Edit the apache config: <pre> nano /etc/httpd/conf/httpd.conf </pre> #* And add/modify the following to ensure PHP, prefork and cgi are enabled: <pre> #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 </pre> * Append the Zoneminder inclusion to the apache config: <pre> 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 </pre> #* *NOTE*: I needed to comment out the @php_admin_value@ in httpd-zoneminder.conf file. h3. Configure PHP * Edit the PHP configuration: <pre> nano /etc/php/php.ini </pre> #* Ensure the following extensions are enabled: <pre> extension=pdo_mysql.so extension=gd.so extension=gettext.so extension=mcrypt.so extension=sockets.so extension=openssl.so extension=ftp.so </pre> #* Ensure open_basedir has the following directories added/included: <pre> open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/dev/:/etc:/srv/http/zoneminder:/srv/zoneminder/:/var/cache/zoneminder/ </pre> #* Set the local timezone: <pre> date.timezone = America/Los_Angeles </pre> h3. Initialize MySQL * Initialize the MySQL database: <pre> cd /usr mysql_install_db --user=mysql --ldata=/var/lib/mysql/ </pre> * Start and enable MySQL on boot: <pre> systemctl enable mysqld systemctl start mysqld </pre> * Secure the installation: <pre> mysql_secure_installation </pre> * Import the zoneminder SQL data: <pre> 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 </pre> * Set permissions on the zm database for the user +zmuser+ with the password +zoneminder+ <pre> 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 </pre> * Edit the zoneminder config <pre> nano /etc/zm.conf </pre> #* And update the host, database, username, and/or password: <pre> ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zoneminder </pre> h2. Start Zoneminder * Start and enable Apache on boot: <pre> systemctl enable httpd systemctl start httpd </pre> * Start and enable zoneminder on boot: <pre> systemctl enable zoneminder systemctl start zoneminder </pre> h2. Resources * https://wiki.archlinux.org/index.php/ZoneMinder * https://aur.archlinux.org/packages/zoneminder/