1) Keep the default zone apache.conf without the ScriptAlias.
2) Stop both zoneminder and apache2
sudo service apache2 stop
sudo service zoneminder stop
2) Remove any stale sockets from /tmp/zm (default location):
sudo rm -vf /tmp/zm/*.*
3) sudo a2enmod cgi
4) Start zoneminder
sudo service zoneminder start
5) Start apache2
sudo service apache2 start
I found out that the order was important for step 4 and 5, otherwise it doesn’t work