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

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.