Enable ZoneMinder Multi-port Mode on Centos 7

Multi-port is a work-around for the six simultaneous connections per domain linmit in Chrome and WebKit. When implemented, ZoneMinder outputs each monitor’s video stream on a separate port, which Chrome considers a separate domain.

The instructions and forum posts I found on the web were all for Debian-based distros. I run ZoneMinder on CentOS 7. When RPMFusion recently updated ZoneMinder to 1.34.0 (stable), I took the opportunity to enable multi-port mode. This is actually easier on CentOS and other RedHat-based distros than it is on Debian or Ubuntu. So here’s how. Begin by pointing your browser to:

https://your.server.hostname/zm/index.php?view=options&tab=network

Enter “30000” (without quotes) in the MIN_STREAMING_PORT field, then click the SAVE button. This tells ZoneMinder to stream video each monitor on a port number equaling 30000 + the monitor number. So if your system has eight monitors, ZoneMinder serves the first monitor stream on port 30001, the second on 30002, etc. up to port 30008.

We’re not done. Apache must be configured to listen on the assigned ports. Since the upgrade to ZoneMinder 1.34.0 forces client connections via ssl we’ll be editing ssl.conf. Unlike Debian, this is the only file we need to edit for the default RPMFusion installation of ZoneMinder on CentOS 7. Prior to editing, make a back-up copy:

sudo cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak

Next , lets edit the ssl.conf file. I detest VI’s user interface, so I use Nano: 

sudo nano -w /etc/httpd/conf.d/ssl.conf

Scroll down to the line that reads “Listen 443 https”, then add a line corresponding to each new port ZoneMinder needs to stream video, one per monitor starting with 30001. Assuming a system with eight monitors, the new lines are:

Listen 30001 https
Listen 30002 https
Listen 30003 https
Listen 30004 https
Listen 30005 https
Listen 30006 https
Listen 30007 https
Listen 30008 https

Next, find the line which reads “<VirtualHost _default_:443>” and edit to include the new streaming ports for ZoneMinder, separated by spaces. For the above example with three monitors, the new line would look like this:

<VirtualHost _default_:443 *:3001 *:30002 *:30003 *:30004 *:30005 *:30006 *:30007 *:30008>

Write out the file, then exit Nano. Next, test the Apache configuration:

sudo apachectl -t

Correct any errors, then re-test. Once all is well, restart Apache:

sudo systemctl restart httpd

Then restart ZoneMinder:

sudo systemctl restart zoneminder

Lastly, we must open the range of new ports in the firewall:

sudo firewall-cmd --zone=public add-port=30001-30008/tcp

Your server should answer <success>.

sudo firewall-cmd --zone=public add-port=30001-30008/tcp --permanent

Your server should answer <success>.

sudo firewall-cmd --reload

Your server should answer <success>. Now point your browser to:

https://your.server.hostname/zm/index.php?view=montage

You should see all of your monitors streaming on the Montage page. Congrats! Go get yourself a beer.