Research project aimed to port ZoneMinder to Umvirt Linux From Scratch.
Zoneminder is not just LAMP-stack application it also videoprocessing application.
Therefore Xorg and multimedia packages are needed.
If you wish to work with WEB-application locally with Falkon browser install it after KDE or LXQT installation.
If you wish to work with WEB-application remotely install it after MATE, XFCE installation.
To install zoneminder package and it dependencies in ULFS just run:
chimp install zoneminder
This command installs zoneminder and its dependencies:
Apache HTTP-server should be edited to execute PHP-scripts. There are many ways how to do that. In BLFS book FastCGI PHP Module (php-fpm) is described.
To enable PHP-scripts execution in Apache HTTP-server with php-fpm just copy and paste:
sed -i -e '/proxy_module/s/^#//' \
-e '/proxy_fcgi_module/s/^#//' \
/etc/httpd/httpd.conf
echo \
'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
/etc/httpd/httpd.conf
echo "AddType application/x-httpd-php-source .phps" >> /etc/httpd/httpd.conf
sed -i -e "s/DirectoryIndex index.html/DirectoryIndex index.html index.php/" /etc/httpd/httpd.conf
To enable php-fpm systemd-service run:
cd /usr/share/blfs-systemd-units/
make install-php-fpm
To start php-fpm systemd-service run:
systemctl start php-fpm.service
To enable Apache HTTP-server systemd-service (httpd) run:
cd /usr/share/blfs-systemd-units/
make install-httpd
To start Apache HTTP-server systemd-service (httpd) run:
systemctl start httpd
Open browser on other machine and open website on this machine address.
You have to get message: "It works!"
Durning zoneminder package installation only MariaDB client is installed to remote MariaDB server connection.
If you wish to install MariaDB server you have to install it on machine with ZoneMinder (local) or other (remote) machine.
To install MariaDB-server run:
chimp install mariadb-server
After installation you should to start MariaDB-server basic configuration. To do that run:
install -v -m755 -o mariadb -g mariadb -d /run/mariadb &&
mariadbd-safe --user=mariadb 2>&1 >/dev/null &
To enable MariaDB-server systemd-service run:
cd /usr/share/blfs-systemd-units/
make install-mariadb
To start MariaDB-server systemd-service run:
systemctl start mariadb
To create database run:
cat /usr/share/zoneminder/db/zm_create.sql | mysql
To create user and grant access to it run:
echo 'grant lock tables,alter,create,index,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";'\
| mysql
Set apache user as owner on web-application directory.
chown apache:apache -R /usr/share/zoneminder/www
Replace http-server documents directory to symlink on Zone Minder web-application directory
cd /srv
mv www www_
ln -s /usr/share/zoneminder/www
Edit web-application file "/srv/www/includes/config.php" and set another config file name ("zm.php.conf", for example).
Copy original /etc/zm.conf to another config file name defined in "/srv/www/includes/config.php". For example:
cp /etc/zm.conf /etc/zm.php.conf
In original /etc/zm.conf file edit database type and replace "mysql" to "MariaDB" (keep letter registers).
On another config file replace string
ZM_DB_HOST=localhost
to
ZM_DB_HOST=127.0.0.1:3306
Edit zoneminder.service file if you wish to run it localy
nano /usr/lib/systemd/system/zoneminder.service
Uncomment line
#After=network.target mariadb.service
Comment line
After=network.target
To enable zoneminder systemd-service run
systemctl enable zoneminder
To start zoneminder systemd-service run
systemctl start zoneminder
To check zoneminder systemd-service run
systemctl status zoneminder
You should get:
● zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled; preset: enabled)
Active: active (running) since Wed 2025-05-28 12:48:38 UTC; 4s ago
Open browser on other machine and open website on this machine address.
You have to get Web-application interface and zoneminder service indicator (top-right corner) should display "RUNNING".