Zoneminder and Odroid XU4 - needed a working setup! -> the last is 20.04 and ZM 1.36.19

pat2
Posts: 84
Joined: Sun Jan 06, 2019 2:22 am
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: Zoneminder and Odroid XU4 - needed a working setup => Ubuntu 20.04 and ZM 1.36.19

Post by pat2 »

========================================================================
1. To enable HTTPS
========================================================================
To enable https for ZM in the easy way through self signed certificate (there is another method using letsencrypt certificates, I will explain later), go in terminal:

Add SSL to Apache2

-create a self-signed certificate:

sudo make-ssl-cert generate-default-snakeoil --force-overwrite

It creates the following files:

/etc/ssl/private/ssl-cert-snakeoil.key
/etc/ssl/certs/ssl-cert-snakeoil.pem

-activate Apache SSL module:

sudo a2enmod ssl

-activate Apache default ssl virtual host:

sudo a2ensite default-ssl

-restart Apache:

sudo service apache2 restart

You should now be able to access the web server using:

https://IP_of_the_board (e.g. https://192.168.1.213)
https://IP_of_the_board/zm (e.g. https://192.168.1.213/zm) for Zoneminder

Depending on the browser, you will receive a warning about a potential risk since you are accessing a site with a seld signed certificate.
It's not an issue, it's your self signed certificate, you can trust on it :-). In the browser go to Advanced and Accept the risk and continue.
You will reach your site in LAN.


You are exposing in LAN your site in HTTPS and with authenticated logon. You are ready to expose it in WAN (the real risk is in WAN!).


========================================================================
2. To enable visibility of the LAN HTTPS site in WAN
========================================================================
Enable portforwarding of 443 port on your router; it depends by your router. On ASUS: go in WAN/Port Forwarding

Service name: HTTPS_Port_Forwarding
Port: 443
Local IP: IP_of_the_board (e.g.: 192.168.1.213)
Local port:443
Protocol: TCP

You should now be able to access the web server in WAN using https://WanRouterIP/zm (e.g. https://5.157.104.224/zm)

========================================================================
3. To to get a domain name
========================================================================
Through Dynamic DNS functionalities on your router (if you have an ASUS or DLink router such functionalities are present) or using services like NOIP you could link dynamically your WanRouterIP to a static hostname (e.g. https://hostname or https://hostname/zm for Zoneminder).

So, in this way you could expose in a secure https way (1) the ZM service in WAN (2) through a static web address (3) with an authenticated access (0).
The authentication data and all the video stream flows will be encrypted.

========================================================================
To configure ZM Ninja with authentication in HTTPS
========================================================================
1. What is your Zoneminder portal url?
- insert IP_of_the_board/zm (for example 192.168.1.213/zm) or in WAN WanRouterIP/zm (e.g. 5.157.104.224/zm) or in WAN (with DDNS) hostname/zm (e.g. hostname/zm)

2. Next, select a protocol,
- choice HTTPS

3 and the following steps are the same.
Last edited by pat2 on Thu Jun 16, 2022 7:26 pm, edited 30 times in total.
These users thanked the author pat2 for the post:
odroid (Mon Jun 13, 2022 9:24 am)

pat2
Posts: 84
Joined: Sun Jan 06, 2019 2:22 am
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: Zoneminder and Odroid XU4 - needed a working setup => Ubuntu 20.04 and ZM 1.36.19

Post by pat2 »

=======================================================================
To install Let's Encrypt certificate
========================================================================
If you was able to get a domain name, you could use LetsEncrypt, instead of self signed, certificate.

sudo nano /etc/apache2/sites-available/hostname.conf

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName hostname
ServerAlias www.hostname
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

sudo a2ensite hostname.conf
sudo apache2ctl configtest
sudo systemctl reload apache2

sudo apt install certbot python3-certbot-apache
sudo certbot --apache


you will be asked if the cerifiticate is for hostname or www.hostname (in my case my site is without www, so in my case the answer is 1).
you will be asked if to redirect traffic to HTTPS (the answer is yes).

DONE!

Your site will be visible in WAN, with authenticated login, redirected to HTTPS and with a Letsencrypt certificate!
You could check trying https://hostname or https://hostname/zm and verify the lock (intead of the self signed certificate you will have a Letsencrypt certificate!!!)

For camera installation if your camera is present on the ZM DB, you will have video stream and PTZ. If no, in general for each camera is possible to find the right configuration in ZM for video stream and PTZ command. Furthermore you could use the ONVIF camera detection functionalities of ZM.

The big advantage of ZM/zmNinja is that it's COMPLETELY FREE and you could use whatever camera.
Last edited by pat2 on Thu Jun 16, 2022 7:27 pm, edited 29 times in total.
These users thanked the author pat2 for the post:
odroid (Mon Jun 13, 2022 10:57 pm)

User avatar
mad_ady
Posts: 10643
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 645 times
Been thanked: 915 times
Contact:

Re: Zoneminder and Odroid XU4 - needed a working setup!

Post by mad_ady »

Thanks for keeping the procedure documented!

pat2
Posts: 84
Joined: Sun Jan 06, 2019 2:22 am
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: Zoneminder and Odroid XU4 - needed a working setup! -> the last is 20.04 and ZM 1.36.19

Post by pat2 »

Thanks to you,mad, for your contribute! Each time I need, there is a fast answer in the forum of You, Odroid, memeka,...thanks to you.
I'm still using your fantastic procedure for backup and restore!! and currently my XU4's USB3 port is used at its fast speed through the suggestions of odroid!

viewtopic.php?t=22930

viewtopic.php?f=95&t=15302

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests