<?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=Jdusablon</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=Jdusablon"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Jdusablon"/>
	<updated>2026-05-01T15:15:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=23820</id>
		<title>Configure a Wireguard interface (wg)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=23820"/>
		<updated>2023-07-25T16:47:02Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Minor formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:WireGuard}}&lt;br /&gt;
{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
WireGuard has become a nearly ubiquitous vpn solution for multiple platform and is available in the community repository since Alpine 3.10. WireGuard itself is now integrated into the linux kernel since v5.6. Only the userland configuration tools are required.&lt;br /&gt;
&lt;br /&gt;
== Install required packages ==&lt;br /&gt;
&lt;br /&gt;
The most straightforward method, and the one recommended in WireGuard documentation, is to use &amp;lt;code&amp;gt;wg-quick&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Install wireguard-tools, iptables, and sysctl:&lt;br /&gt;
&lt;br /&gt;
 apk add wireguard-tools-wg-quick&lt;br /&gt;
 apk add iptables&lt;br /&gt;
 apk add sysctl&lt;br /&gt;
&lt;br /&gt;
== Create Server Keys and Interface Config ==&lt;br /&gt;
&lt;br /&gt;
Create a server private and public key:&lt;br /&gt;
&lt;br /&gt;
 wg genkey | tee server.privatekey | wg pubkey &amp;gt; server.publickey&lt;br /&gt;
&lt;br /&gt;
Then, we create a new config file &amp;lt;code&amp;gt;/etc/wireguard/wg0.conf&amp;lt;/code&amp;gt; using these new keys:&lt;br /&gt;
&lt;br /&gt;
 [Interface]&lt;br /&gt;
 Address = 192.168.2.1/24&lt;br /&gt;
 ListenPort = 45340&lt;br /&gt;
 PrivateKey = &amp;lt;server private key value&amp;gt; # the key from the previously generated privatekey file&lt;br /&gt;
 PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;iptables -A FORWARD -o %i -j ACCEPT&lt;br /&gt;
 PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;iptables -D FORWARD -o %i -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
The PostUp and PostDown iptable rules forward traffic from the wg0 subnet (192.168.2.1/24) to the lan subnet on interface eth0.&lt;br /&gt;
&lt;br /&gt;
Refer to [https://github.com/pirate/wireguard-docs#user-content-config-reference this WireGuard documentation] for information on adding peers to the config file.&lt;br /&gt;
&lt;br /&gt;
Bring up the new wg0 interface:&lt;br /&gt;
&lt;br /&gt;
 wg-quick up wg0&lt;br /&gt;
&lt;br /&gt;
To take it down, we can use &amp;lt;code&amp;gt;wg-quick down wg0&amp;lt;/code&amp;gt; which will clean up the interface and remove the iptables rules.&lt;br /&gt;
Note: If running in a Docker container, you will need to run with &amp;lt;code&amp;gt;--cap-add=NET_ADMIN&amp;lt;/code&amp;gt; to modify your interfaces.&lt;br /&gt;
&lt;br /&gt;
== Enable IP Forwarding ==&lt;br /&gt;
&lt;br /&gt;
With a NAT destination rule in place on your router, you should be able connect to the wireguard instance and access the host. However, if you intend for peers to be able to access external resources (including the internet), you will need to enable ip forwarding.&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt; (or a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; file under &amp;lt;code&amp;gt;/etc/sysctl.d/&amp;lt;/code&amp;gt;) and add the following line:&lt;br /&gt;
&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
Add the sysctl service to run at boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add sysctl &lt;br /&gt;
&lt;br /&gt;
Then either reboot or run &amp;lt;code&amp;gt;sysctl -p /etc/sysctl.conf&amp;lt;/code&amp;gt; to reload the settings. To ensure forwarding is turned on, run &amp;lt;code&amp;gt;sysctl -a | grep ip_forward&amp;lt;/code&amp;gt; and ensure &amp;lt;code&amp;gt;net.ipv4.ip_forward&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Running with modloop ==&lt;br /&gt;
&lt;br /&gt;
If you are running from a RAM disk, you can&#039;t modify the modloop.&lt;br /&gt;
&lt;br /&gt;
You can get around it by unpacking the modloop, mounting the unpacked modules folder, then installing WireGuard.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 apk add squashfs-tools # install squashfs tools to unpack modloop&lt;br /&gt;
 unsquashfs -d /root/squash /lib/modloop-lts # unpack modloop to root dir&lt;br /&gt;
 umount /.modloop # unmount existing modloop&lt;br /&gt;
 mount /root/squash/ /.modloop/ # mount unpacked modloop&lt;br /&gt;
 apk del wireguard-lts # uninstall previous WireGuard install&lt;br /&gt;
 apk add wireguard-lts&lt;br /&gt;
 apk add wireguard-tools&lt;br /&gt;
&lt;br /&gt;
You can repack the squash filesystem or put this script in the /etc/local.d/ path so it runs at boot-up.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=23819</id>
		<title>Configure a Wireguard interface (wg)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=23819"/>
		<updated>2023-07-25T15:55:55Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Update procedure for wg now integrated in kernel, add ip_forward, add notes about ip forwarding.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC left}}&lt;br /&gt;
&lt;br /&gt;
WireGuard has become a nearly ubiquitous vpn solution for multiple platform and is available in the community repository since Alpine 3.10.&lt;br /&gt;
&lt;br /&gt;
WireGuard itself is now integrated into the linux kernel since v5.6. Only the userland configuration tools are required.&lt;br /&gt;
&lt;br /&gt;
== Install required packages ==&lt;br /&gt;
&lt;br /&gt;
The most straightforward method, and the one recommended in WireGuard documentation, is to use &amp;lt;code&amp;gt;wg-quick&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Install wireguard-tools, iptables, and sysctl:&lt;br /&gt;
&lt;br /&gt;
 apk add wireguard-tools-wg-quick&lt;br /&gt;
 apk add iptables&lt;br /&gt;
 apk add sysctl&lt;br /&gt;
&lt;br /&gt;
== Create Server Keys and Interface Config ==&lt;br /&gt;
&lt;br /&gt;
Create a server private and public key:&lt;br /&gt;
&lt;br /&gt;
 wg genkey | tee server.privatekey | wg pubkey &amp;gt; server.publickey&lt;br /&gt;
&lt;br /&gt;
Then, we create a new config file &amp;lt;code&amp;gt;/etc/wireguard/wg0.conf&amp;lt;/code&amp;gt; using these new keys:&lt;br /&gt;
&lt;br /&gt;
 [Interface]&lt;br /&gt;
 Address = 192.168.2.1/24&lt;br /&gt;
 ListenPort = 45340&lt;br /&gt;
 PrivateKey = &amp;lt;server private key value&amp;gt; # the key from the previously generated privatekey file&lt;br /&gt;
 PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;iptables -A FORWARD -o %i -j ACCEPT&lt;br /&gt;
 PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;iptables -D FORWARD -o %i -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
The PostUp and PostDown iptable rules forward traffic from the wg0 subnet (192.168.2.1/24) to the lan subnet on interface eth0.&lt;br /&gt;
&lt;br /&gt;
Refer to [https://github.com/pirate/wireguard-docs#user-content-config-reference this WireGuard documentation] for information on adding peers to the config file.&lt;br /&gt;
&lt;br /&gt;
Bring up the new wg0 interface:&lt;br /&gt;
&lt;br /&gt;
 wg-quick up wg0&lt;br /&gt;
&lt;br /&gt;
To take it down, we can use &amp;lt;code&amp;gt;wg-quick down wg0&amp;lt;/code&amp;gt; which will clean up the interface and remove the iptables rules.&lt;br /&gt;
Note: If running in a Docker container, you will need to run with &amp;lt;code&amp;gt;--cap-add=NET_ADMIN&amp;lt;/code&amp;gt; to modify your interfaces.&lt;br /&gt;
&lt;br /&gt;
== Enable IP Forwarding ==&lt;br /&gt;
&lt;br /&gt;
With a NAT destination rule in place on your router, you should be able connect to the wireguard instance and access the host. However, if you intend for peers to be able to access external resources (including the internet), you will need to enable ip forwarding.&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt; (or a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; file under &amp;lt;code&amp;gt;/etc/sysctl.d/&amp;lt;/code&amp;gt;) and add the following line:&lt;br /&gt;
&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
Add the sysctl service to run at boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add sysctl &lt;br /&gt;
&lt;br /&gt;
Then either reboot or run &amp;lt;code&amp;gt;sysctl -p /etc/sysctl.conf&amp;lt;/code&amp;gt; to reload the settings. To ensure forwarding is turned on, run &amp;lt;code&amp;gt;sysctl -a | grep ip_forward&amp;lt;/code&amp;gt; and ensure &amp;lt;code&amp;gt;net.ipv4.ip_forward&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Running with modloop ==&lt;br /&gt;
&lt;br /&gt;
If you are running from a RAM disk, you can&#039;t modify the modloop.&lt;br /&gt;
&lt;br /&gt;
You can get around it by unpacking the modloop, mounting the unpacked modules folder, then installing WireGuard.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 apk add squashfs-tools # install squashfs tools to unpack modloop&lt;br /&gt;
 unsquashfs -d /root/squash /lib/modloop-lts # unpack modloop to root dir&lt;br /&gt;
 umount /.modloop # unmount existing modloop&lt;br /&gt;
 mount /root/squash/ /.modloop/ # mount unpacked modloop&lt;br /&gt;
 apk del wireguard-lts # uninstall previous WireGuard install&lt;br /&gt;
 apk add wireguard-lts&lt;br /&gt;
 apk add wireguard-tools&lt;br /&gt;
&lt;br /&gt;
You can repack the squash filesystem or put this script in the /etc/local.d/ path so it runs at boot-up.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=NZBGet&amp;diff=23765</id>
		<title>NZBGet</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=NZBGet&amp;diff=23765"/>
		<updated>2023-07-04T08:24:03Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
* This guide explains how to install the popular service [https://nzbget.net/ nzbget] on Alpine Linux. Specifically, the environment used is 3.18 running in an LXC container. This guide should still work in a standard Alpine Linux install.&lt;br /&gt;
* This guide sets up nzbget as a standard rc init service.&lt;br /&gt;
* The path {{path|/opt}} is used in this guide, however the choice of path is immaterial to the outcome, for example, {{path|/srv}} should work fine.&lt;br /&gt;
* This guide assumes all commands are run as root unless specified.&lt;br /&gt;
&lt;br /&gt;
== Download and install nzbget ==&lt;br /&gt;
&lt;br /&gt;
Fetch and install the latest nzbget install script. (If you have security concerns, nzbget code is available to inspect at [https://github.com/nzbget/nzbget github]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget https://nzbget.net/download/nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the install script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod +x nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;./nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move the nzbget directory to {{path|/opt}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv nzbget /opt/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Create nzbget service=&lt;br /&gt;
&lt;br /&gt;
Create the nzbget init file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vi /etc/init.d/nzbget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/sbin/openrc-run&lt;br /&gt;
 &lt;br /&gt;
depend() {&lt;br /&gt;
	need net&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
start() {&lt;br /&gt;
	/opt/nzbget/nzbget -D&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
stop() {&lt;br /&gt;
	/opt/nzbget/nzbget -Q&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the commands &amp;lt;code&amp;gt;/opt/nzbget/nzbget -D&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/opt/nzbget/nzbget -Q&amp;lt;/code&amp;gt; are used to cleanly start and stop the service.&lt;br /&gt;
&lt;br /&gt;
Add the service to rc init:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add nzbget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* At this point, you should be able to reach nzbget at &#039;&#039;&#039;http://&amp;lt;YOURIP&amp;gt;:6789&#039;&#039;&#039;. You should be able to start and stop the nzbget service and the service should start after a system restart/reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb start&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb stop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Any further configs can be set using the webgui or in {{path|/opt/nzbget/nzbget.conf}}.&lt;br /&gt;
* Of note is the line in {{path|/opt/nzbget/nzbget.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows the service to start and run as a specific user, which is a common setup if nzbget is used in conjunction with other media managers and shared storage. Note that any working directories specified in the settings will require their permissions updated to work correctly.&lt;br /&gt;
* nzbget is quite descriptive in its logs. Check nzbget&#039;s &#039;&#039;&#039;Messages&#039;&#039;&#039; section for errors, including permissions and paths.&lt;br /&gt;
&lt;br /&gt;
== Updating nzbget ==&lt;br /&gt;
&lt;br /&gt;
As of version 21.2, the certificate that ships with nzbget for updating from nzbget.net is expired and updates will consequently fail until it is updated. Fortunately, this can be rectified:&lt;br /&gt;
&lt;br /&gt;
Stop the nzbget service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget stop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run the nzbget service under any other user than root, change this back to root temporarily for the update in {{path|/opt/nzbget/nzbget.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fetch the new and valid certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;curl --remote-name --time-cond cacert.pem https://nzbget.net/info/cacert.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move the new certificate to the correct path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv cacert.pem /opt/nzbget/cacert.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the nzbget service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Navigate to your instance of nzbget, Settings, System, Update NZBGet:&lt;br /&gt;
&lt;br /&gt;
[[File:2023-07-04 01-07.png|thumb|left|nzbget update screenshot]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If required, stop the nzbget service again and revert the DaemonUsername to its normal value in {{path|/opt/nzbget/nzbget.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget stop&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and start the service again:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:Networking]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=NZBGet&amp;diff=23764</id>
		<title>NZBGet</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=NZBGet&amp;diff=23764"/>
		<updated>2023-07-04T08:20:15Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Initial page setup for nzbget install under Alpine Linux 3.18&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
* This guide explains how to install the popular service [https://nzbget.net/ nzbget] on Alpine Linux. Specifically, the environment used is 3.18 running in an LXC container. This guide should still work in a standard Alpine Linux install.&lt;br /&gt;
* This guide sets up nzbget as a standard rc init service.&lt;br /&gt;
* The path {{path|/opt}} is used in this guide, however the choice of path is immaterial to the outcome, for example, {{path|/srv}} should work fine.&lt;br /&gt;
* This guide assumes all commands are run as root unless specified.&lt;br /&gt;
&lt;br /&gt;
== Download and install nzbget ==&lt;br /&gt;
&lt;br /&gt;
Fetch and install the latest nzbget install script. (If you have security concerns, nzbget code is available to inspect at [https://github.com/nzbget/nzbget github]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget https://nzbget.net/download/nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the install script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod +x nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;./nzbget-latest-bin-linux.run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move the nzbget directory to {{path|/opt}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv nzbget /opt/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Create nzbget service=&lt;br /&gt;
&lt;br /&gt;
Create the nzbget init file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vi /etc/init.d/nzbget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/sbin/openrc-run&lt;br /&gt;
 &lt;br /&gt;
depend() {&lt;br /&gt;
	need net&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
start() {&lt;br /&gt;
	/opt/nzbget/nzbget -D&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
stop() {&lt;br /&gt;
	/opt/nzbget/nzbget -Q&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the commands &amp;lt;code&amp;gt;/opt/nzbget/nzbget -D&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/opt/nzbget/nzbget -Q&amp;lt;/code&amp;gt; are used to cleanly start and stop the service.&lt;br /&gt;
&lt;br /&gt;
Add the service to rc init:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add nzbget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* At this point, you should be able to reach nzbget at &#039;&#039;&#039;http://&amp;lt;YOURIP&amp;gt;:6789&#039;&#039;&#039;. You should be able to start and stop the nzbget service and the service should start after a system restart/reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb start&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzb stop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Any further configs can be set using the webgui or in /opt/nzbget/nzbget.conf.&lt;br /&gt;
* Of note is the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows the service to start and run as a specific user, which is a common setup if nzbget is used in conjunction with other media managers and shared storage. Note that any working directories specified in the settings will require their permissions updated to work correctly.&lt;br /&gt;
* nzbget is quite descriptive in its logs. Check nzbget&#039;s &#039;&#039;&#039;Messages&#039;&#039;&#039; section for errors, including permissions and paths.&lt;br /&gt;
&lt;br /&gt;
== Updating nzbget ==&lt;br /&gt;
&lt;br /&gt;
As of version 21.2, the certificate that ships with nzbget for updating from nzbget.net is expired and updates will consequently fail until it is updated. Fortunately, this can be rectified:&lt;br /&gt;
&lt;br /&gt;
Stop the nzbget service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget stop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you run the nzbget service under any other user than root, change this back to root temporarily for the update in {{{path|/opt/nzbget/nzbget.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fetch the new and valid certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;curl --remote-name --time-cond cacert.pem https://nzbget.net/info/cacert.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move the new certificate to the correct path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv cacert.pem /opt/nzbget/cacert.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the nzbget service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Navigate to your instance of nzbget, Settings, System, Update NZBGet:&lt;br /&gt;
&lt;br /&gt;
[[File:2023-07-04 01-07.png|thumb|left|nzbget update screenshot]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If required, stop the nzbget service again and revert the DaemonUsername to its normal value in {{path|/opt/nzbget/nzbget.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget stop&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;DaemonUsername=root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and start the service again:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service nzbget start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category:Networking]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=File:2023-07-04_01-07.png&amp;diff=23763</id>
		<title>File:2023-07-04 01-07.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=File:2023-07-04_01-07.png&amp;diff=23763"/>
		<updated>2023-07-04T08:08:29Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nzbget update screenshot&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=UniFi_Controller&amp;diff=23762</id>
		<title>UniFi Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=UniFi_Controller&amp;diff=23762"/>
		<updated>2023-07-04T06:41:58Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Add warning about the effective deprecation of MongoDB on Alpine Linux &amp;gt;v.3.9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= &#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039; =&lt;br /&gt;
&lt;br /&gt;
The Ubiquiti Unifi controller linux self-contained java image relies on MongoDB, and MongoDB has been removed from alpine linux packages after version 3.9 due to SPL license changes. MongoDB can technically be installed by adding Alpine Linux 3.9 repositories and installing mongodb and yaml-cpp=0.6.2-r2, however this solution requires pinning yaml-cpp to version 0.6.2, which is likely to cause issues with any other packages relying on yaml parsing using yaml-cpp.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install the generic Unix UniFi Controller, as available from [http://www.ui.com/ Ubiquiti Networks]. At the time of writing this, a native Alpine Linux package is not available.&lt;br /&gt;
&lt;br /&gt;
Furthermore, this guide uses the incredibly reliable and efficient [http://www.skarnet.org/software/s6/ s6] supervision suite to start and control the UniFi Controller.&lt;br /&gt;
&lt;br /&gt;
A summarized schematic of what will be installed on the filesystem.&lt;br /&gt;
&lt;br /&gt;
The choice of {{path|/srv}} for the UniFi Controller&#039;s root directory is based on the fact that it contains both run-time and configuration data, so installing to {{path|/usr/local}}, {{path|/opt}} or {{path|/home}} didn&#039;t seem appropriate. Feel free to adjust the steps below, replacing {{path|/srv/unifi}} with wherever you would prefer to install the UniFi Controller software.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/&lt;br /&gt;
`--etc&lt;br /&gt;
   |-- unifi&lt;br /&gt;
   |   `-- log&lt;br /&gt;
   |-- srv&lt;br /&gt;
   |   `-- unifi&lt;br /&gt;
   |       |-- bin&lt;br /&gt;
   |       |-- conf&lt;br /&gt;
   |       |-- data&lt;br /&gt;
   |       |-- dl&lt;br /&gt;
   |       |-- lib&lt;br /&gt;
   |       |-- logs&lt;br /&gt;
   |       |-- run&lt;br /&gt;
   |       `-- webapps&lt;br /&gt;
   |-- run&lt;br /&gt;
   |   `-- openrc&lt;br /&gt;
   |          `-- s6-scan&lt;br /&gt;
   |              `-- unifi --&amp;gt; /etc/unifi&lt;br /&gt;
    `-- var&lt;br /&gt;
        `-- log&lt;br /&gt;
            `-- unifi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Prerequisite Packages =&lt;br /&gt;
&lt;br /&gt;
== OpenJDK 8 JRE ==&lt;br /&gt;
&lt;br /&gt;
Install &amp;lt;code&amp;gt;openjdk8-jre&amp;lt;/code&amp;gt; from the community repository.&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/apk/repositories&amp;lt;/code&amp;gt; and uncomment the appropriate community repository for your Alpine version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://host.name/alpine_version/community&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the package cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add openjdk8-jre&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MongoDB ==&lt;br /&gt;
&lt;br /&gt;
Install MongoDB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add mongodb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== s6 ==&lt;br /&gt;
&lt;br /&gt;
Install [http://www.skarnet.org/software/s6/ s6]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add s6&amp;lt;/code&amp;gt; which is a service supervision suite, for reliably and efficiently starting, stopping and keeping services running.&lt;br /&gt;
&lt;br /&gt;
The below shows a schematic process tree of how the UniFi Controller will be started and supervised by s6. The controller is written in Java, hence the Java process and it in turn, launches a dedicated instance of MongoDB to store its configuration and run-time data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init&lt;br /&gt;
`-- s6-svscan&lt;br /&gt;
    `-- s6-supervise&lt;br /&gt;
        |-- s6-log&lt;br /&gt;
        `-- java&lt;br /&gt;
            `-- mongod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Install UniFi Controller =&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;unifi&amp;lt;/code&amp;gt; user and group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;adduser -D -H -h /srv/unifi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the parent folder within which you wish to install the UniFi Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /srv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download the generic unix archive of the &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; you wish to install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget http://www.ubnt.com/downloads/unifi/VERSION/UniFi.unix.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unpack the archive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unzip UniFi.unix.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rename the unpacked directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv UniFi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change ownership.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chown -R unifi:unifi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lock down permissions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod o-rwx unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change into the UniFi bin directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /srv/unifi/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the existing file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rm mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a symlink to &amp;lt;code&amp;gt;/usr/bin/mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s /usr/bin/mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Service Management =&lt;br /&gt;
&lt;br /&gt;
== Create UniFi Service Directory and Files ==&lt;br /&gt;
&lt;br /&gt;
Create an s6 service directory for UniFi.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir -p /etc/unifi/log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt; script, using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/unifi/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
user=&#039;unifi&#039;&lt;br /&gt;
group=&#039;unifi&#039;&lt;br /&gt;
&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
base=&#039;/srv/unifi&#039;&lt;br /&gt;
&lt;br /&gt;
if [ -d $base ]; then&lt;br /&gt;
    cd $base&lt;br /&gt;
    chown -R $user:$group .&lt;br /&gt;
    version=`head -1 webapps/ROOT/app-unifi/.version`&lt;br /&gt;
    echo &amp;quot;Starting UniFi Controller $version&amp;quot;&lt;br /&gt;
    exec s6-setuidgid $user java -jar lib/ace.jar start&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;Missing $base ... aborting&amp;quot;&lt;br /&gt;
    touch down&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt; script is executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/unifi/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;log/run&amp;lt;/code&amp;gt; script, using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/unifi/log/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
log_user=&#039;log&#039;&lt;br /&gt;
&lt;br /&gt;
exec s6-setuidgid $log_user s6-log -b n20 s1000000 t /var/log/unifi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the log/run script is executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/unifi/log/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create log User and Directory ==&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; user and group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;adduser -D -H -h /var/log log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;/var/log/unifi&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir -p /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the directory ownership.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chown log:log /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lock down the permissions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 750 /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the OpenRC Service Script ==&lt;br /&gt;
&lt;br /&gt;
Open the script file using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/init.d/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/sbin/openrc-run&lt;br /&gt;
&lt;br /&gt;
name=&amp;quot;unifi&amp;quot;&lt;br /&gt;
supervisor=s6&lt;br /&gt;
s6_service_path=&amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
depend() {&lt;br /&gt;
	need net s6-svscan&lt;br /&gt;
	after firewall&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
start_pre() {&lt;br /&gt;
        if [ ! -L &amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot; ]; then&lt;br /&gt;
	        ln -s &amp;quot;/etc/${name}&amp;quot; &amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the script is executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/init.d/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start the UniFi Controller Service ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service unifi start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure the UniFi Controller Service to start on boot ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add unifi boot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Simple Backup Script =&lt;br /&gt;
&lt;br /&gt;
Create &amp;lt;code&amp;gt;/usr/local/bin/unifi-backup&amp;lt;/code&amp;gt; using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This script assumes the use of s6-svc to control unifi. I will modify it in time, to use rc-service instead.&lt;br /&gt;
&lt;br /&gt;
Paste the following into the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
conf_dir=&#039;/etc/unifi&#039;&lt;br /&gt;
backup_dir=&#039;/srv/backup/unifi&#039;&lt;br /&gt;
service_dir=&#039;/run/openrc/s6-scan/unifi&#039;&lt;br /&gt;
&lt;br /&gt;
start_state=&#039;down&#039;&lt;br /&gt;
&lt;br /&gt;
if s6-svok $service_dir; then&lt;br /&gt;
    if s6-svstat -o up,ready $service_dir | grep -q true; then&lt;br /&gt;
        echo &#039;Stopping the UniFi Controller&#039;&lt;br /&gt;
        start_state=&#039;up&#039;&lt;br /&gt;
        s6-svc -d $service_dir&lt;br /&gt;
        sleep 3&lt;br /&gt;
    fi&lt;br /&gt;
else&lt;br /&gt;
    echo &#039;Warning: The UniFi Controller is not supervised&#039;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if s6-svstat -o up $service_dir | grep -q false; then&lt;br /&gt;
    echo &#039;Success: The UniFi Controller was stopped&#039;&lt;br /&gt;
else&lt;br /&gt;
    echo &#039;Error: The UniFi Controller is still running&#039;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
stamp=`date +%Y-%m-%d_%H%M%S`&lt;br /&gt;
&lt;br /&gt;
mkdir -p $backup_dir&lt;br /&gt;
cd $backup_dir&lt;br /&gt;
mkdir &amp;quot;data-$stamp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Backing up to /srv/backup/unifi/data-$stamp.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if rsync -az /srv/unifi/data/ &amp;quot;data-$stamp&amp;quot;; then&lt;br /&gt;
    echo &#039;* rsync succeeded&#039;&lt;br /&gt;
    if tar czf &amp;quot;data-$stamp.tar.gz&amp;quot; &amp;quot;data-$stamp&amp;quot;; then&lt;br /&gt;
        echo &#039;* tar succeeded&#039;&lt;br /&gt;
        rm -rf &amp;quot;data-$stamp&amp;quot;&lt;br /&gt;
        echo &#039;Backup succeeded&#039;&lt;br /&gt;
    else&lt;br /&gt;
        echo &#039;Backup failed: tar failed&#039;&lt;br /&gt;
	exit 1&lt;br /&gt;
    fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$start_state&amp;quot; == &#039;up&#039; ]; then&lt;br /&gt;
    echo &#039;Starting the UniFi Controller&#039;&lt;br /&gt;
    s6-svc -u $service_dir&lt;br /&gt;
    sleep 5&lt;br /&gt;
    s6-svstat $service_dir&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:Networking]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_Transmission_(bittorrent)_with_Clutch_WebUI&amp;diff=23514</id>
		<title>Setting up Transmission (bittorrent) with Clutch WebUI</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_Transmission_(bittorrent)_with_Clutch_WebUI&amp;diff=23514"/>
		<updated>2023-05-25T19:51:57Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Corrected install package name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This document will show you how you can setup Transmission BitTorrent client on Alpine Linux and control it with a nice HTTP web-interface. I assume that you know the basics about Alpine Linux (package management and internals) and you have enough storage available to store your downloaded media (ie USB hard-drive) and of course a working internet connection.&lt;br /&gt;
&lt;br /&gt;
== Setting up Transmission ==&lt;br /&gt;
&lt;br /&gt;
Lets install it:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add transmission-daemon}}&lt;br /&gt;
&lt;br /&gt;
This should install Transmission 3.0.0. After the installation is complete you should have default configuration file for init in: &lt;br /&gt;
&lt;br /&gt;
 /etc/conf.d/transmission-daemon&lt;br /&gt;
&lt;br /&gt;
By default, transmission will run as the user &amp;quot;transmission&amp;quot;. If you need to make changes, do so, and save them. You can restart transmission-daemon and see if all is working ok:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service transmission-daemon restart}}&lt;br /&gt;
&lt;br /&gt;
To configure the transmission settings (including the download location), edit the configuration file:&lt;br /&gt;
&lt;br /&gt;
 /var/lib/transmission/config/settings.json&lt;br /&gt;
&lt;br /&gt;
If everything is OK you should see transmission-daemon running with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|ps}}&lt;br /&gt;
&lt;br /&gt;
If you change the download location in the settings, remember to transfer ownership to the transmission user and group.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|chown -R transmission:transmission &amp;lt;DOWNLOAD_FODLER&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
It may also be convienent for the &amp;quot;root&amp;quot; user to be able to access the files when administering the server. An easy way to do this is to add the root user to the transmission group:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|addgroup root transmission}}&lt;br /&gt;
&lt;br /&gt;
Lets add transmission to our system start:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add transmission-daemon}}&lt;br /&gt;
&lt;br /&gt;
The transmission web GUI will run on http://&amp;lt;IP_ADDRESS&amp;gt;:9091/transmission&lt;br /&gt;
&lt;br /&gt;
== Saving your changes to disk ==&lt;br /&gt;
&lt;br /&gt;
Now is a good time to write you changes to disk:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lbu_commit device}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=23416</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=23416"/>
		<updated>2023-05-12T08:18:47Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: &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;
&lt;br /&gt;
==Base Install==&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;
Then, 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;
&#039;&#039;Note: In Alpine 3.17, php 8.1 replaces php8.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk add zoneminder mariadb mysql-client lighttpd php81-fpm php81-pdo php81-pdo_mysql&lt;br /&gt;
&lt;br /&gt;
===Database===&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;
===Web Server===&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;
&#039;&#039;Note: for php 8.1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 vi /etc/php81/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, and &amp;lt;code&amp;gt;mod_rewrite&amp;lt;/code&amp;gt;, for the api. 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;
In order for video streaming to work in 1.36, you&#039;ll need the following&lt;br /&gt;
added to /etc/lighttpd/lighttpd.conf:&lt;br /&gt;
 server.stream-response-body = 1&lt;br /&gt;
&lt;br /&gt;
In lighttpd.conf for the API, we will want to redirect any api+ requests to cakephp. Thus, add:&lt;br /&gt;
 url.rewrite = (&lt;br /&gt;
       &amp;quot;^/zm/api(.+)$&amp;quot;           =&amp;gt;              &amp;quot;/zm/api/index.php&amp;quot;&lt;br /&gt;
 )&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;
Also add the following to alias.url in mod_cgi.conf so that it looks like&lt;br /&gt;
&lt;br /&gt;
 alias.url = (&lt;br /&gt;
     &amp;quot;/cgi-bin/&amp;quot;            =&amp;gt;      var.basedir + &amp;quot;/cgi-bin/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/api&amp;quot;              =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/api/app/webroot/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/&amp;quot;                 =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Remove the symlink in /var/www/localhost/htdocs (we will be using the alias, not the symlink). &lt;br /&gt;
 unlink /var/www/localhost/htdocs/zm&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;
&#039;&#039;Note:&#039;&#039; for php-fpm8, use the follwing command:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/php-fpm81 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;
===Zoneminder===&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. Note that if you are using a diskless install, you must lbu add /var/cache/zoneminder.&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;
===Conclusion===&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 test the API, run&lt;br /&gt;
 curl -X GET  http://yourserver/zm/api/host/getVersion.json&lt;br /&gt;
(This assumes you aren&#039;t using authentication.)&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>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=23403</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=23403"/>
		<updated>2023-05-10T08:17:50Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Update php conf line for php8.1&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;
&lt;br /&gt;
==Base Install==&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;
Then, 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;
&#039;&#039;Note: In Alpine 3.17, php 8.1 replaces php8.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk add zoneminder mariadb mysql-client lighttpd php81-fpm php81-pdo php81-pdo_mysql&lt;br /&gt;
&lt;br /&gt;
===Database===&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;
===Web Server===&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;
&#039;&#039;Note: for php 8.1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 vi /etc/php81/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, and &amp;lt;code&amp;gt;mod_rewrite&amp;lt;/code&amp;gt;, for the api. 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;
In order for video streaming to work in 1.36, you&#039;ll need the following&lt;br /&gt;
added to /etc/lighttpd/lighttpd.conf:&lt;br /&gt;
 server.stream-response-body = 1&lt;br /&gt;
&lt;br /&gt;
In lighttpd.conf for the API, we will want to redirect any api+ requests to cakephp. Thus, add:&lt;br /&gt;
 url.rewrite = (&lt;br /&gt;
       &amp;quot;^/zm/api(.+)$&amp;quot;           =&amp;gt;              &amp;quot;/zm/api/index.php&amp;quot;&lt;br /&gt;
 )&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;
Also add the following to alias.url in mod_cgi.conf so that it looks like&lt;br /&gt;
&lt;br /&gt;
 alias.url = (&lt;br /&gt;
     &amp;quot;/cgi-bin/&amp;quot;            =&amp;gt;      var.basedir + &amp;quot;/cgi-bin/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/api&amp;quot;              =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/api/app/webroot/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/&amp;quot;                 =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Remove the symlink in /var/www/localhost/htdocs (we will be using the alias, not the symlink). &lt;br /&gt;
 unlink /var/www/localhost/htdocs/zm&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;
===Zoneminder===&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. Note that if you are using a diskless install, you must lbu add /var/cache/zoneminder.&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;
===Conclusion===&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 test the API, run&lt;br /&gt;
 curl -X GET  http://yourserver/zm/api/host/getVersion.json&lt;br /&gt;
(This assumes you aren&#039;t using authentication.)&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>Jdusablon</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&amp;diff=23402</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=23402"/>
		<updated>2023-05-10T08:02:13Z</updated>

		<summary type="html">&lt;p&gt;Jdusablon: Add package requirements for Alpine 3.17&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;
&lt;br /&gt;
==Base Install==&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;
Then, 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;
&#039;&#039;Note: In Alpine 3.17, php 8.1 replaces php8.0&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk add zoneminder mariadb mysql-client lighttpd php81-fpm php81-pdo php81-pdo_mysql&lt;br /&gt;
&lt;br /&gt;
===Database===&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;
===Web Server===&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, and &amp;lt;code&amp;gt;mod_rewrite&amp;lt;/code&amp;gt;, for the api. 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;
In order for video streaming to work in 1.36, you&#039;ll need the following&lt;br /&gt;
added to /etc/lighttpd/lighttpd.conf:&lt;br /&gt;
 server.stream-response-body = 1&lt;br /&gt;
&lt;br /&gt;
In lighttpd.conf for the API, we will want to redirect any api+ requests to cakephp. Thus, add:&lt;br /&gt;
 url.rewrite = (&lt;br /&gt;
       &amp;quot;^/zm/api(.+)$&amp;quot;           =&amp;gt;              &amp;quot;/zm/api/index.php&amp;quot;&lt;br /&gt;
 )&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;
Also add the following to alias.url in mod_cgi.conf so that it looks like&lt;br /&gt;
&lt;br /&gt;
 alias.url = (&lt;br /&gt;
     &amp;quot;/cgi-bin/&amp;quot;            =&amp;gt;      var.basedir + &amp;quot;/cgi-bin/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/api&amp;quot;              =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/api/app/webroot/&amp;quot;,&lt;br /&gt;
     &amp;quot;/zm/&amp;quot;                 =&amp;gt;      &amp;quot;/usr/share/webapps/zoneminder/htdocs/&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Remove the symlink in /var/www/localhost/htdocs (we will be using the alias, not the symlink). &lt;br /&gt;
 unlink /var/www/localhost/htdocs/zm&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;
===Zoneminder===&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. Note that if you are using a diskless install, you must lbu add /var/cache/zoneminder.&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;
===Conclusion===&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 test the API, run&lt;br /&gt;
 curl -X GET  http://yourserver/zm/api/host/getVersion.json&lt;br /&gt;
(This assumes you aren&#039;t using authentication.)&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>Jdusablon</name></author>
	</entry>
</feed>