Firefox montage view server-wide solution
Posted: Thu Jan 10, 2019 6:27 pm
There is known issue that affects Firefox users when they view Montage page.
Firefox imposes limit of how many simultaneous connections can be established per server. As a result, some cameras on Montage page will not be displayed.
The FAQ suggest one solution: https://zoneminder.readthedocs.io/en/la ... in-firefox, which requires tweaking browser settings.
I came up with a server-wide solution that does not require end-users to change anything in their browsers. It's suitable for installations with many end-users where it is inconvenient or impossible to ask users to change settings in their browsers. Additional benefit of avoiding browser settings change is that the change will affect how Firefox interacts with all other hosts, not only Zoneminder server.
This solution is relatively advanced and assumes that Zoneminder server is accessed with a hostname which is part of domain that you control (and therefore can manage its DNS zone).
The main idea is to take advantage of the fact that in Zoneminder each camera can be assigned to a particular server: https://zoneminder.readthedocs.io/en/la ... g-monitors.
We can add multiple server entries with different hostnames in Zoneminder config as described in the documentation: https://zoneminder.readthedocs.io/en/la ... rvers.html.
The trick is to make these hostnames resolve to IP address of Zoneminder server. This needs to be done in DNS zone configuration by adding "A" or "CNAME" records for newly added hostnames.
For example, if hostname of Zoneminder server is "zm.example.com" and its IP address is 192.168.1.1, we can add "server1.zm.example.com", "server2.zm.example.com", "server3.zm.example.com", which will all resolve to the same IP address as "zm.example.com" - 192.168.1.1. When this is done, we should be able to access Zoneminder server by using any of these hostnames.
Then, we assign first few cameras (3 or 4) to "server1.zm.example.com", next few to "server2.zm.example.com", next few to "server3.zm.example.com" etc, so that amount of cameras assigned to each server is less or equal to Firefox's connection limit setting.
For those who runs Zoneminder's Web interface over https with a properly signed certificate, the server's SSL certificate will need to include all additionally created hostnames as "Certificate Subject Alt Name".
In this way, when you open Montage view, Firefox will successfully load all cameras, because for browser there will be different hosts: "server1.zm.example.com", "server2.zm.example.com and "server3.zm.example.com" and even though they all point to one physical location, they are considered as different hosts by the browser.
For single users on Linux machines this can also be done without DNS server by adding entries to /etc/hosts file.
This solution is fully transparent for end-users. They do not need to know anything about those additional hostnames. End users still access the Web interface with "zm.example.com" and they will have fully workable Montage view page.
I decided to share this method so others can benefit from it and so that it can be added to FAQ if maintainers will deem it necessary.
Firefox imposes limit of how many simultaneous connections can be established per server. As a result, some cameras on Montage page will not be displayed.
The FAQ suggest one solution: https://zoneminder.readthedocs.io/en/la ... in-firefox, which requires tweaking browser settings.
I came up with a server-wide solution that does not require end-users to change anything in their browsers. It's suitable for installations with many end-users where it is inconvenient or impossible to ask users to change settings in their browsers. Additional benefit of avoiding browser settings change is that the change will affect how Firefox interacts with all other hosts, not only Zoneminder server.
This solution is relatively advanced and assumes that Zoneminder server is accessed with a hostname which is part of domain that you control (and therefore can manage its DNS zone).
The main idea is to take advantage of the fact that in Zoneminder each camera can be assigned to a particular server: https://zoneminder.readthedocs.io/en/la ... g-monitors.
We can add multiple server entries with different hostnames in Zoneminder config as described in the documentation: https://zoneminder.readthedocs.io/en/la ... rvers.html.
The trick is to make these hostnames resolve to IP address of Zoneminder server. This needs to be done in DNS zone configuration by adding "A" or "CNAME" records for newly added hostnames.
For example, if hostname of Zoneminder server is "zm.example.com" and its IP address is 192.168.1.1, we can add "server1.zm.example.com", "server2.zm.example.com", "server3.zm.example.com", which will all resolve to the same IP address as "zm.example.com" - 192.168.1.1. When this is done, we should be able to access Zoneminder server by using any of these hostnames.
Then, we assign first few cameras (3 or 4) to "server1.zm.example.com", next few to "server2.zm.example.com", next few to "server3.zm.example.com" etc, so that amount of cameras assigned to each server is less or equal to Firefox's connection limit setting.
For those who runs Zoneminder's Web interface over https with a properly signed certificate, the server's SSL certificate will need to include all additionally created hostnames as "Certificate Subject Alt Name".
In this way, when you open Montage view, Firefox will successfully load all cameras, because for browser there will be different hosts: "server1.zm.example.com", "server2.zm.example.com and "server3.zm.example.com" and even though they all point to one physical location, they are considered as different hosts by the browser.
For single users on Linux machines this can also be done without DNS server by adding entries to /etc/hosts file.
This solution is fully transparent for end-users. They do not need to know anything about those additional hostnames. End users still access the Web interface with "zm.example.com" and they will have fully workable Montage view page.
I decided to share this method so others can benefit from it and so that it can be added to FAQ if maintainers will deem it necessary.