Habemus image! Guys, I got it working. The culprit was a setting in Options/Paths.
Here is the installation walkthrough:
Zoneminder 1.28.1 installation on Debian Jessie
1. Upgrade system:
#apt-get update
#apt-get upgrade
2. Add jessie-backports repository to /apt/sources.list:
deb http://http.debian.net/debian jessie-backports main
#apt-get update
#apt-get upgrade
3. Install zoneminder:
#apt-get install zoneminder
(you will be prompted for Mysql root password)
4. If it is a new installation, create database and user. If not, update the old database and skip to step 9.
#mysql -u root -p
(give mysql root password at the prompt)
mysql>create database zm;
5. Check if the database was created
mysql>use zm;
mysql>show tables;
6. Create zoneminder user
mysql>create user 'zmuser'@'localhost' identified by 'zmpass';
(you can change whenever you want the password for the user with: mysql> set password for 'zmuser'@'localhost' = password('blablabla');
mysql>grant all privileges on zm.* to 'zmuser'@'localhost';
mysql>quit;
7. Create database structure:
#mysql -u root -p -h localhost zm < /usr/share/zoneminder/db/zm_create.sql
8. Now let's check that the user can access database and that the db structure was created:
#mysql -u zmuser -p
(give the zmuser password at the prompt)
mysql>use zm;
mysql>show tables;
If all was ok, the table structure will be displayed.
mysql>quit
9. Edit /etc/zm/zm.conf, set the database name, username and password values to the ones you have used when creating the database and zoneminder user. Basically you can set any name to the database and the zoneminder user, just make sure that the values match with those in zm.conf.
10. Set permissions of /etc/zm/zm.conf to root:www-data 740, enable zoneminder at boot and start it
#chmod 740 /etc/zm/zm.conf
#chown root:www-data /etc/zm/zm.conf
#systemctl enable zoneminder.service
Start zoneminder
#systemctl start zoneminder.service
If everything is ok, zoneminder should start without errors.
11. Enable CGI and Zoneminder configuration in Apache.
#a2enmod cgi
#a2enconf zoneminder
12. Restart apache
#systemctl restart apache2.service
13.Access zoneminder console in the browser
http://server_IP/zm
Zoneminder is OK, except for the image streaming. You will have the error messages: "
socket_sendto( /tmp/zm/zms-697660s.sock ) failed: No such file or directory" and "
getStreamCmdResponse stream error: socket_sendto( /tmp/zm/zms-697660s.sock ) failed: No such file or directory - checkStreamForErrors()"
This is due to a misconfiguration of the cgi scripts path. If you look in /etc/apache2/conf-enabled/zoneminder.conf you will see that there is an alias for the cgi scripts "/zm/cgi.bin" pointing to the location of the zms scripts (/usr/lib/zoneminder/cgi-bin). This is correct, since we're accessing the web interface through an alias: sever_IP/zm. The wrong thing is the path to the zms script in the interface options. To correct this, go to "Options" and under "Paths tab" change the value of "PATH_ZMS" from "
/cgi-bin/nph-zms" to "
/zm/cgi-bin/nph-zms". Now you will be able to access the live view and the event view.
14. - optional - The documentation on installing zoneminder on Ubuntu server recommends to disable zm updates, probably to avoid surprises upon updates being automatically installed.
Go to "Options", under "System" tab, uncheck "CHECK_FOR_UPDATES" option.
15. - optional - if you're using Internet Explorer, install Cambozola (basically you will have to download it, unpack it and copy cambozola.jar to /usr/share/zoneminder/www. Then in "Options" under "Image" tab check the "OPT_CAMBOZOLA" option.
Add a monitor, etc...
Enjoy!