Multi-Port, Storage Areas and more

Apr 5, 2018 · 3 min read

Recent ZM versions (I think ZM 1.32+) added a feature that allows you to stream as many monitors as possible and not be limited to the Chrome and Webkit limit of 6 simultaneous connections.

Today’s post is about Multi Port. If you have seen zmNinja’s montage feature, you’ll notice the frames update every 2 seconds and they don’t look as smooth as ZoneMinder’s console view . Well, that’s because Chrome & WebKit limit a max of 6 simultaneous connections to a domain and to avoid that, I take snapshots and reload them every 2 seconds. Explained here.

As it turns out, these browsers doesn’t mandate this limit if you change the port. That is, & will all be treated as different domains as far as the connection limit goes. In other words, if we somehow stream each monitor on its own port, you can view as many as you want.

This is what multi-port does.

If you are on StorageAreas, and enable multi-port, the next release of zmNinja will automatically support it and no more staccato streaming in Montage, and more more 5 monitor limit in event montage.

To enable Multi Port:

(And this is why I have the wha..whaa…whaaat? image caption)

STEP 1: Enable it in the Zoneminder UI

Here I am telling ZM that start my streaming at port 30000. What ZM will do then is it will stream every monitor at MIN_STREAMING_PORT+monitorId. In other words, lets say you have 3 monitors with monitoriId=1 monitorId=3 and monitorId=7 then they will be streamed on ports 30001 30003 and 30007 respectively.

Image for post
Image for post

STEP 2: That’s not complex, this is! Modify your Apache config

You now need to tell Apache to start “Listen”ing on those ports.

That involves modifying ports.conf (usually in /etc/apache2)

<IfModule ssl_module>
Listen 9010 https # this is my custom port for the ZM portal
Listen 30001 https # this is for my first monitor with ID=1
Listen 30002 https # this is for my second monitor with ID=2
Listen 30004 https # this is for my third monitor with ID=4

And also modifying your Virtualhost which in my case is in /etc/apache2/sites-enabled/default-ssl.conf

<VirtualHost *:9010 *:30001 *:30002 *:30004>
# whatever else follows

To make sure you’ve set things correctly, do a sudo apachectl -t if it says your changes are ok,

sudo service apache2 restart

And enjoy multi port streaming.

STEP 3: Oh not yet, not yet

If you need to access this instance from outside, you also need to configure your router to port forward all these ports to your internal server

Image for post
Image for post
My router config

STEP 4: Oh not yet, not yet redux

Kidding. Have fun.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store