Debian Jessie install from repo

Forum for questions and support relating to the 1.28.x releases only.
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian Jessie install from repo

Post by bbunge »

Your errors seem to be consistent with cameras that are not set up right. If you installed Ubuntu 14.04 and followed the instructions to the letter you should have a ZM system that starts and runs without errors. Your errors come in once you set up a camera and the settings are not right. Which settings are right? Good question! I discovered some stuff about Phillips cameras and ZM. They do not do high resolution or frame rate well and seem to hog up memory (don't mess with the shared memory settings in 14.04 as the newer versions of ZM are compiled to use mmapp) Start with 320x240 and 5.00 FPS. Try PAL and PAL B with Auto. You may have to dig through the forum or WIKI for other settings. Running something made for Windows under Linux can be a problem.

As for the Debial 8.1 install. I got it to run with the back-ports install but can't get video from the camera. The camera does work and is saving events. Yes, I have CGI enabled and have tried a bunch of things that did not work. There must be something that Ubuntu tasksel configures that installing MySQL and PHP one at a time misses.

Back to Win 10 upgrades which are working well!
stlth
Posts: 12
Joined: Wed Mar 23, 2011 10:43 pm

Re: Debian Jessie install from repo

Post by stlth »

I don't think so. This cameras worked well for past 4 years with 'motion' !!!
Four cameras configured 640x480@15FPS YUV420P no one fu**** error in 4 years of work!

But okay. Disconnected Philips webcam, connected Logitech C270, configured 320x240@5FPS.
Live video - OK.
Twice Prev <? in events - crash, socket_sendto and other sh**.
felixr
Posts: 21
Joined: Tue Aug 13, 2013 2:14 pm

Re: Debian Jessie install from repo

Post by felixr »

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!
Last edited by felixr on Sun Aug 02, 2015 8:27 pm, edited 3 times in total.
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian Jessie install from repo

Post by bbunge »

Great!

A couple of things:

ZM does not start upon reboot

USB cams do not work

Database creation can be shorter:

Create Zoneminder database in MySQL

cd /usr/share/zoneminder/db

mysql --user=root --password=(root password) < zm_create.sql

mysql --user=root --password=(root password)

grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';

\q (enter) (to quit)

Am working on fixes for these and an "Easy" write up for the WIKI

bb
felixr
Posts: 21
Joined: Tue Aug 13, 2013 2:14 pm

Re: Debian Jessie install from repo

Post by felixr »

bbunge wrote:ZM does not start upon reboot
Ups, forgot about that.
#systemctl enable zoneminder.service

I have added that to the walkthrough.
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian Jessie install from repo

Post by bbunge »

Local cams including USB need:

adduser www-data video

Restart ZM.

WIKI write up in process...:-)
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Debian Jessie install from repo

Post by bbunge »

Here you go!

http://www.zoneminder.com/wiki/index.ph ... e_Easy_Way

Thanks folks for the assistance!!! I think I did learn a bit about the differences between Ubuntu and Debian. Actually, I think the Debian runs a bit smoother?
felixr
Posts: 21
Joined: Tue Aug 13, 2013 2:14 pm

Re: Debian Jessie install from repo

Post by felixr »

You're welcome, bbunge. By the way, in Debian you don't need "sudo", neither to add regular users in the sudoers list. Just login as a regular user, issue the "su" command, give the root password and you're in as root.
Locked