<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ranger0665</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ranger0665"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ranger0665"/>
	<updated>2026-04-29T20:24:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=22349</id>
		<title>ZoneMinder video camera security and surveillance</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=22349"/>
		<updated>2022-10-02T21:55:50Z</updated>

		<summary type="html">&lt;p&gt;Ranger0665: Additional lighttpd configurations needed for latest version of zoneminder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.zoneminder.com/ ZoneMinder] usually runs with [[Apache]], but in this short how-to we use [[Lighttpd]].&lt;br /&gt;
&lt;br /&gt;
ZoneMinder is found in the community repositories, please enable it by following the instructions [[Repositories#Enabling_the_community_repository|here]]&lt;br /&gt;
&lt;br /&gt;
First, add the needed packages to our system&lt;br /&gt;
&lt;br /&gt;
 apk add zoneminder mariadb mysql-client lighttpd php8-fpm php8-pdo php8-pdo_mysql&lt;br /&gt;
&lt;br /&gt;
Initialize [https://www.mysql.com/ MySQL] database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/mariadb setup&lt;br /&gt;
&lt;br /&gt;
Start the database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/mariadb start&lt;br /&gt;
&lt;br /&gt;
Set root password for MySQL as instructed by MySQL setup&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/mysqladmin -u root password &#039;your_secure_root_mysql_password&#039;&lt;br /&gt;
&lt;br /&gt;
You can log into MySQL as current root user with&lt;br /&gt;
 mysql&lt;br /&gt;
&lt;br /&gt;
Create a ZoneMinder MySQL database and user&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; create database zm;&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; CREATE USER zmuser@localhost IDENTIFIED BY &#039;your_zm_password_as_set_in_config&#039;;&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; grant ALL on zm.* to zmuser@localhost;&lt;br /&gt;
&lt;br /&gt;
We are running &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt;, so let&#039;s run &amp;lt;code&amp;gt;php-fpm&amp;lt;/code&amp;gt; as lighttpd user/group&lt;br /&gt;
&lt;br /&gt;
 vi /etc/php8/php-fpm.conf&lt;br /&gt;
&lt;br /&gt;
Add this section to the bottom of the file:&lt;br /&gt;
&lt;br /&gt;
 ; Unix user/group of processes&lt;br /&gt;
 ; Note: The user is mandatory. If the group is not set, the default user&#039;s group&lt;br /&gt;
 ;       will be used.&lt;br /&gt;
 ;user = nobody&lt;br /&gt;
 ;group = nobody&lt;br /&gt;
 user = lighttpd&lt;br /&gt;
 group = lighttpd&lt;br /&gt;
&lt;br /&gt;
Enable the php cgi fpm config in &amp;lt;code&amp;gt;lighttpd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
Go down to the server modules section and uncomment &amp;lt;code&amp;gt;mod_alias&amp;lt;/code&amp;gt;, which is needed for the cgi-bin. It should look like:&lt;br /&gt;
&lt;br /&gt;
 # {{{ modules&lt;br /&gt;
 # At the very least, mod_access and mod_accesslog should be enabled.&lt;br /&gt;
 # All other modules should only be loaded if necessary.&lt;br /&gt;
 # NOTE: the order of modules is important.&lt;br /&gt;
 server.modules = (&lt;br /&gt;
 #    &amp;quot;mod_rewrite&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_redirect&amp;quot;,&lt;br /&gt;
      &amp;quot;mod_alias&amp;quot;,&lt;br /&gt;
      &amp;quot;mod_access&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_cml&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_trigger_b4_dl&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_auth&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_status&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_setenv&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_proxy&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_simple_vhost&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_evhost&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_userdir&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_deflate&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_ssi&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_usertrack&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_expire&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_secdownload&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_rrdtool&amp;quot;,&lt;br /&gt;
 #    &amp;quot;mod_webdav&amp;quot;,&lt;br /&gt;
      &amp;quot;mod_accesslog&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
 # }}}&lt;br /&gt;
&lt;br /&gt;
Go down to the includes section, it should look like:&lt;br /&gt;
 # {{{ includes&lt;br /&gt;
 include &amp;quot;mime-types.conf&amp;quot;&lt;br /&gt;
 # uncomment for cgi support&lt;br /&gt;
    include &amp;quot;mod_cgi.conf&amp;quot;&lt;br /&gt;
 # uncomment for php/fastcgi support&lt;br /&gt;
 #   include &amp;quot;mod_fastcgi.conf&amp;quot;&lt;br /&gt;
 # uncomment for php/fastcgi fpm support&lt;br /&gt;
    include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # }}}&lt;br /&gt;
&lt;br /&gt;
Edit lighttpd cgi config and add old style cgi support by adding to cgi.assign&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lighttpd/mod_cgi.conf&lt;br /&gt;
&lt;br /&gt;
which should look like&lt;br /&gt;
&lt;br /&gt;
 cgi.assign = (&lt;br /&gt;
     &amp;quot;&amp;quot;      =&amp;gt;      &amp;quot;&amp;quot;,&lt;br /&gt;
     &amp;quot;.pl&amp;quot;   =&amp;gt;      &amp;quot;/usr/bin/perl&amp;quot;,&lt;br /&gt;
     &amp;quot;.cgi&amp;quot;  =&amp;gt;      &amp;quot;/usr/bin/perl&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Start php-fpm&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/php-fpm8 start&lt;br /&gt;
&lt;br /&gt;
Start lighttpd&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/lighttpd start&lt;br /&gt;
&lt;br /&gt;
Set the MySQL hostname, username, password.&lt;br /&gt;
&lt;br /&gt;
Change the ZoneMinder user (&amp;lt;code&amp;gt;ZM_WEB_USER&amp;lt;/code&amp;gt;) and group (&amp;lt;code&amp;gt;ZM_WEB_GROUP&amp;lt;/code&amp;gt;) to lighttpd&lt;br /&gt;
&lt;br /&gt;
And set &amp;lt;code&amp;gt;ZM_SERVER_HOST&amp;lt;/code&amp;gt; to your ZoneMinder hostname/ipaddress&lt;br /&gt;
&lt;br /&gt;
 vi /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Which should look like:&lt;br /&gt;
&lt;br /&gt;
 # Username and group that web daemon (httpd/apache) runs as&lt;br /&gt;
 ZM_WEB_USER=lighttpd&lt;br /&gt;
 ZM_WEB_GROUP=lighttpd&lt;br /&gt;
 ZM_PATH_DATA=/usr/share/zoneminder&lt;br /&gt;
&lt;br /&gt;
 # ZoneMinder database type: so far only mysql is supported&lt;br /&gt;
 ZM_DB_TYPE=mysql&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database hostname or ip address&lt;br /&gt;
 ZM_DB_HOST=localhost&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database name&lt;br /&gt;
 ZM_DB_NAME=zm&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database user&lt;br /&gt;
 ZM_DB_USER=zmuser&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database password&lt;br /&gt;
 ZM_DB_PASS=your_zm_password_as_set_in_config&lt;br /&gt;
 &lt;br /&gt;
 # Host of this machine&lt;br /&gt;
 ZM_SERVER_HOST=yourserver&lt;br /&gt;
&lt;br /&gt;
Change ownership of &amp;lt;code&amp;gt;zm.conf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 chown lighttpd.lighttpd /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Zoneminder will create a cache in &amp;lt;code&amp;gt;/var/cache/zoneminder&amp;lt;/code&amp;gt; which isn&#039;t created by default. Create this directory and allow lighttpd access to it:&lt;br /&gt;
&lt;br /&gt;
 mkdir /var/cache/zoneminder&lt;br /&gt;
 chown lighttpd.lighttpd /var/cache/zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initialize the ZoneMinder database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/zoneminder setup&lt;br /&gt;
&lt;br /&gt;
Start ZoneMinder&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/zoneminder start&lt;br /&gt;
&lt;br /&gt;
Profit!&lt;br /&gt;
&lt;br /&gt;
To access ZoneMinder, browse to &amp;lt;nowiki&amp;gt;http://yourserver/zm/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make it start automatically on boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add lighttpd default&lt;br /&gt;
 rc-update add mariadb default&lt;br /&gt;
 rc-update add php-fpm8 default&lt;br /&gt;
 rc-update add zoneminder default&lt;br /&gt;
&lt;br /&gt;
== Added notes to work with Nginx ==&lt;br /&gt;
Later to add some notes about running via nginx&lt;br /&gt;
&lt;br /&gt;
==Related Links==&lt;br /&gt;
* https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Browser_Client - Kiosk to watch Streams&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Ranger0665</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=22348</id>
		<title>ZoneMinder video camera security and surveillance</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=22348"/>
		<updated>2022-10-02T12:56:57Z</updated>

		<summary type="html">&lt;p&gt;Ranger0665: Added community repo reference, changed vim to vi, updated PHP5 to PHP8 references, fixed zm.conf to proper location, added reference to start/connect to MySql&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.zoneminder.com/ ZoneMinder] usually runs with [[Apache]], but in this short how-to we use [[Lighttpd]].&lt;br /&gt;
&lt;br /&gt;
ZoneMinder is found in the community repositories, please enable it by following the instructions [[Repositories#Enabling_the_community_repository|here]]&lt;br /&gt;
&lt;br /&gt;
First, add the needed packages to our system&lt;br /&gt;
&lt;br /&gt;
 apk add zoneminder mariadb mysql-client lighttpd php8-fpm php8-pdo php8-pdo_mysql&lt;br /&gt;
&lt;br /&gt;
Initialize [https://www.mysql.com/ MySQL] database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/mariadb setup&lt;br /&gt;
&lt;br /&gt;
Start the database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/mariadb start&lt;br /&gt;
&lt;br /&gt;
Set root password for MySQL as instructed by MySQL setup&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/mysqladmin -u root password &#039;your_secure_root_mysql_password&#039;&lt;br /&gt;
&lt;br /&gt;
You can log into MySQL as current root user with&lt;br /&gt;
 mysql&lt;br /&gt;
&lt;br /&gt;
Create a ZoneMinder MySQL database and user&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; create database zm;&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; CREATE USER zmuser@localhost IDENTIFIED BY &#039;your_zm_password_as_set_in_config&#039;;&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; grant ALL on zm.* to zmuser@localhost;&lt;br /&gt;
&lt;br /&gt;
We are running &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt;, so let&#039;s run &amp;lt;code&amp;gt;php-fpm&amp;lt;/code&amp;gt; as lighttpd user/group&lt;br /&gt;
&lt;br /&gt;
 vi /etc/php8/php-fpm.conf&lt;br /&gt;
&lt;br /&gt;
Add this section to the bottom of the file:&lt;br /&gt;
&lt;br /&gt;
 ; Unix user/group of processes&lt;br /&gt;
 ; Note: The user is mandatory. If the group is not set, the default user&#039;s group&lt;br /&gt;
 ;       will be used.&lt;br /&gt;
 ;user = nobody&lt;br /&gt;
 ;group = nobody&lt;br /&gt;
 user = lighttpd&lt;br /&gt;
 group = lighttpd&lt;br /&gt;
&lt;br /&gt;
Enable the php cgi fpm config in &amp;lt;code&amp;gt;lighttpd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
Go down to the includes section, it should look like:&lt;br /&gt;
 # {{{ includes&lt;br /&gt;
 include &amp;quot;mime-types.conf&amp;quot;&lt;br /&gt;
 # uncomment for cgi support&lt;br /&gt;
    include &amp;quot;mod_cgi.conf&amp;quot;&lt;br /&gt;
 # uncomment for php/fastcgi support&lt;br /&gt;
 #   include &amp;quot;mod_fastcgi.conf&amp;quot;&lt;br /&gt;
 # uncomment for php/fastcgi fpm support&lt;br /&gt;
    include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # }}}&lt;br /&gt;
&lt;br /&gt;
Edit lighttpd cgi config and add old style cgi support by adding to cgi.assign&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lighttpd/mod_cgi.conf&lt;br /&gt;
&lt;br /&gt;
which should look like&lt;br /&gt;
&lt;br /&gt;
 cgi.assign = (&lt;br /&gt;
     &amp;quot;&amp;quot;      =&amp;gt;      &amp;quot;&amp;quot;,&lt;br /&gt;
     &amp;quot;.pl&amp;quot;   =&amp;gt;      &amp;quot;/usr/bin/perl&amp;quot;,&lt;br /&gt;
     &amp;quot;.cgi&amp;quot;  =&amp;gt;      &amp;quot;/usr/bin/perl&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Start php-fpm&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/php-fpm8 start&lt;br /&gt;
&lt;br /&gt;
Start lighttpd&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/lighttpd start&lt;br /&gt;
&lt;br /&gt;
Set the MySQL hostname, username, password.&lt;br /&gt;
&lt;br /&gt;
Change the ZoneMinder user (&amp;lt;code&amp;gt;ZM_WEB_USER&amp;lt;/code&amp;gt;) and group (&amp;lt;code&amp;gt;ZM_WEB_GROUP&amp;lt;/code&amp;gt;) to lighttpd&lt;br /&gt;
&lt;br /&gt;
And set &amp;lt;code&amp;gt;ZM_SERVER_HOST&amp;lt;/code&amp;gt; to your ZoneMinder hostname/ipaddress&lt;br /&gt;
&lt;br /&gt;
 vi /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Which should look like:&lt;br /&gt;
&lt;br /&gt;
 # Username and group that web daemon (httpd/apache) runs as&lt;br /&gt;
 ZM_WEB_USER=lighttpd&lt;br /&gt;
 ZM_WEB_GROUP=lighttpd&lt;br /&gt;
 ZM_PATH_DATA=/usr/share/zoneminder&lt;br /&gt;
&lt;br /&gt;
 # ZoneMinder database type: so far only mysql is supported&lt;br /&gt;
 ZM_DB_TYPE=mysql&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database hostname or ip address&lt;br /&gt;
 ZM_DB_HOST=localhost&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database name&lt;br /&gt;
 ZM_DB_NAME=zm&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database user&lt;br /&gt;
 ZM_DB_USER=zmuser&lt;br /&gt;
 &lt;br /&gt;
 # ZoneMinder database password&lt;br /&gt;
 ZM_DB_PASS=your_zm_password_as_set_in_config&lt;br /&gt;
 &lt;br /&gt;
 # Host of this machine&lt;br /&gt;
 ZM_SERVER_HOST=yourserver&lt;br /&gt;
&lt;br /&gt;
Change ownership of &amp;lt;code&amp;gt;zm.conf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 chown lighttpd.lighttpd /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Initialize the ZoneMinder database&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/zoneminder setup&lt;br /&gt;
&lt;br /&gt;
Start ZoneMinder&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/zoneminder start&lt;br /&gt;
&lt;br /&gt;
Profit!&lt;br /&gt;
&lt;br /&gt;
To access ZoneMinder, browse to &amp;lt;nowiki&amp;gt;http://yourserver/zm/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make it start automatically on boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add lighttpd default&lt;br /&gt;
 rc-update add mariadb default&lt;br /&gt;
 rc-update add php-fpm8 default&lt;br /&gt;
 rc-update add zoneminder default&lt;br /&gt;
&lt;br /&gt;
== Added notes to work with Nginx ==&lt;br /&gt;
Later to add some notes about running via nginx&lt;br /&gt;
&lt;br /&gt;
==Related Links==&lt;br /&gt;
* https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Browser_Client - Kiosk to watch Streams&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Ranger0665</name></author>
	</entry>
</feed>