Ubuntu 7.04 (Feisty Fawn) installation walkthrough (kind of)

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp » Thu Oct 11, 2007 8:33 pm

mrd wrote:Ok...got the video working bby following the Ubuntu wiki
http://www.zoneminder.com/wiki/index.php/Ubuntu_7.04
which I didn't find on my inital search here...

"chmod 666 /dev/video0"

worked...
This may fail on reboot. The actual fix is listed by me above.

Code: Select all

sudo chmod 4755 /usr/bin/zmfix
As to ffmpeg, it is only used if you want to stream mpeg or export mepeg. I don't miss it.

ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post by ktheking » Sat Oct 20, 2007 4:40 pm

Zonerminder version : 1.22.3
Ubuntu 7.10 Feisty : Alternate version (command line) : http://releases.ubuntu.com/7.10/
AMD900 - 320Mb ram - 80Gb sata hd
PV143 - 4 port video card


Updated 26/12/2007


Used guides for install :
ryscar's direction (see this forum thread)
Lee Sharp's directions (see this forum thread)
Most of the zm functions work ,except :

Problems :
1.ffmpeg encoding not working
2.zip creation not working (tar.gz works)
3.when user authenticating enabled ,streaming stops working



Problem 1 :ffmpeg encoding not working : solved

drubort wrote :
workaround/fix
I resolved it with the follow hack:
on line 323 of zmvideo.pl I removed the "&"
http://www.zoneminder.com/forums/viewtopic.php?t=7250

TIP : if you use 'vi' for editing (to show linenumbers type ':set number' ,to hide the number sagain 'set nonumber')


Problem 2 :zip creation not working (tar.gz works)
still searching ...


Problem 3 :when user authenticating enabled ,streaming stops working.

Already discovered this in apache error log ( /var/log/apache/error.log) : Error, unable to authenticate user
It comes down to this : http://www.mail-archive.com/ubuntu-bugs ... 18717.html
So the problem lies in the .deb package made available by Peter Howard (for which many thanks ..). This package needs to be reworked ,so that it incorporates the package 'libssl-dev'. (this might also come from the fact that openssl is installed in one of the packages of the medibuntu ,which was installed after the install of zoneminder).

Got something very strange :
I did a clean install(with rebuild) ,it seemed at first to be solved.
After enabling user authenticating streaming still worked.
But then after enabling the combozola ,adapted the zm script ( according to http://www.zoneminder.com/wiki/index.ph ... Auto-Start and inserting the zoneminder in init.d for autoboot ,and also rebooting the problem re-appeared again ...
Then surprisingly the day after : it worked again ! I suspect not enough cpu time.

I think I'm on to something ...

I've done the clean install as described in http://www.zoneminder.com/forums/viewto ... 09b1e17e8e

For the additional needed perl modules I used this :
http://www.zoneminder.com/wiki/index.ph ... ZoneMinder

But slightly changed (in order to get medibuntu also on it )

Prepare pre-requisites :

Code: Select all

debian:~#sudo -i
debian:~#vi /etc/apt/sources.list (remove line with cd)
debian:~#apt-get update
debian:~#apt-get upgrade
debian:~# apt-get install ssh

Here you can connect with ssh client (ex. putty) to your ZM machine
And continue the install on your own pc.

debian:~# apt-get install apache2 mysql-server libmysqlclient15-dev php5 php5-mysql g++ make netpbm libssl-dev libjpeg62-dev libmime-perl libwww-perl libarchive-tar-perl libdate-manip-perl libarchive-zip-perl libmime-lite-perl libdbi-perl libdbd-mysql-perl libpcre3-dev

debian:~# echo kernel.shmmax = 134217728 >> /etc/sysctl.conf
debian:~# echo kernel.shmall = 134217728 >> /etc/sysctl.conf
debian:~# reboot

debian:~# wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | apt-key add -
debian:~# wget -q http://www.medibuntu.org/sources.list.d/feisty.list -O /etc/apt/sources.list.d/medibuntu.list

debian:~# wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
debian:~# wget http://wine.budgetdedicated.com/apt/sources.list.d/feisty.list -O /etc/apt/sources.list.d/winehq.list

debian:~# apt-get update

debian:~# apt-get install traceroute p7zip unace rar xfonts-intl-european flashplugin-nonfree sun-java5-plugin faad ffmpeg gstreamer0.10-ffmpeg gstreamer0.10-pitfdll gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse lame liba52-0.7.4 libartsc0 libdc1394-13 libdvdread3 libfaac0 libfaad2-0 libgsm1 libid3tag0 libimlib2 liblame0 libmad0 libmjpegtools0c2a libmms0 libmodplug0c2 libmp4v2-0 libmpcdec3 libmpeg2-4 libsidplay1 libswfdec0.3 libxine1-ffmpeg libxvidcore4 libxvmc1 mjpegtools ntp sox vorbis-tools libdvdcss2 w32codecs msttcorefonts ogle-mmx ogle-gui streamtuner streamripper

Prepare mail capabilities :
Prepare cpan usage :

Code: Select all

apt-get install unzip lynx ncftp
during this phase,the newest pre-requisites for cpan install are installed.This is needed for following module installs :

Code: Select all

    debian:~#perl -MCPAN -e shell 
    
    >cpan : install Bundle::CPAN   (just press 'return' on all questions)
    >cpan : reload
    >cpan : quit
Install sendmail components :

Code: Select all

    apt-get install postfix       (=> choose 'internet' during install , choose your own local domain name or make one up , ex. atmyplace.net)
Get needed perl modules :

Code: Select all

    perl -MCPAN -e shell
    >cpan : install MIME::Tools
    >cpan : install MIME::Lite
    quit
Prepare extra capabilities (X10,serialport)

Code: Select all

    perl -MCPAN -e shell
   >cpan : install Bundle::CPAN
   >cpan : reload CPAN
   >cpan : install Archive::Tar (seems to be optional => depend on the way you install yourdistro)
   >cpan : install Archive::Zip (seems to be optional => depend on the way you install yourdistro)
   >cpan : install DateTime
   >cpan : install Date::Manip updated 2006-03-04 thanx to mickecarlsson
   >cpan : install Bundle::libnet
   >cpan : install Device::SerialPort
   >cpan : install Astro::SunTime Updated 2006 03 24 correct spelling error on SunTime (thanx to mickecarlsson)
   >cpan : install X10
   >cpan : quit
Do ZM install :

Code: Select all

debian:~# wget http://freshmeat.net/redir/zoneminder/33246/url_tgz/ZoneMinder-1.22.3.tar.gz
debian:~# tar -xvzf ZoneMinder-1.22.3.tar.gz
debian:~# cd ZoneMinder-1.22.3
debian:~/ZoneMinder-1.22.3# ./configure  --with-lame=/usr/bin --with-ffmpeg=/usr/bin --with-mysql=/usr/bin --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data
debian:~/ZoneMinder-1.22.3# mysql mysql < db/zm_create.sql
debian:~/ZoneMinder-1.22.3# mysql mysql
mysql> grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
mysql> quit
debian:~/ZoneMinder-1.22.3# mysqladmin reload
debian:~/ZoneMinder-1.22.3# make install

correct the error : sh: Syntax error: Bad fd number

Code: Select all

debian:~/ZoneMinder-1.22.3#dpkg-reconfigure dash
==> Here respond to 'NO'

configure the autostart :
Froml this point on ,the start of ZM has been done ,and you can access it.

correct some path vars :
-connect to http://debian/zm and change this options ...
Paths/ZM_PATH_ZMS - /cgi-bin/zms

enable and correct the authenticating problem :
debian:~#vi /usr/local/bin/zmvideo.pl

type ':set number' to view the linenumbers
go to line '323' and remove the "&" (press x to remove).
type ':wq!' to save

(if you made an error ,type ":q!" to exit vi)

Now go to ZM gui : http://debian/zm ,and enable user authenticating.
Next add your users and passwords in the gui.

gui=Graphical User Interface

Fill in 'ZM_AUTH_HASH_SECRET' field with some custom chosen hash code (ex. abc123)
set field 'ZM_OPT_USE_AUTH' Authenticate user logins to ZoneMinder : enabled

restart ZM (click on 'Running in GUI')


Login field now appears :

the default login is : admin
password : admin

Next change this password ,and add new users if needed.
=> Options => Users


Next reboot the machine (not sure if this is needed ,but I do it anyway..)
Clear cache from your firefox (not sure if this is needed ,but I do it anyway..)
Remove any create monitor instances (not sure if this is needed ,but I do it anyway..)

Check you streaming. (create new monitor ,set to 'monitor' and click 'new')


Install cambozola for IExplore streaming :

Code: Select all

debian:~#cd /usr/local/src
  debian:~#wget http://www.charliemouse.com/code/cambozola/cambozola-latest.tar.gz
  debian:~#tar xvfz cambozola-latest.tar.gz
  debian:~#cp /usr/local/src/cambozola-0.68/dist/cambozola.jar /var/www/zm
  debian:~#chmod 775 /var/www/zm/cambozola.jar
Enable now cambozola in the GUI
Options => Images => ZM_OPT_CAMBOZOLA => enable

zmfilter.pl : Fix background filters , for filter with "Name" set with operator "matches". 26/12/2007 update
source : http://www.zoneminder.com/forums/viewtopic.php?t=10815

Code: Select all

line 378: single quotes missing
   $filter_sql .= " not regexp $value";
    needs to be changed to
   $filter_sql .= " not regexp '$value'"; 

Code: Select all

line 374 : single quotes missing
   $filter_sql .= " regexp $value";
       needs to be changed to
   $filter_sql .= " regexp '$value'";

Extra features that I want to work as well :
1. DYNDNS :
I've added a tool (ddclient) for dyndns update ,so that the machine is reachable from a fixed url name.
I got install instructions here : http://ubuntuguide.org/wiki/Ubuntu:Feisty (search for ddclient)
Dyndns config-guide : http://www.dyndns.com/support/kb/using_ ... vices.html

2. Firewall : still need to do
3. Remote ssh (over wan) :
24/10/2007 update :
My main problem was : How to get trough the proxy (which uses NTLM authenticating). In order to be able to connect to the ZM machine from ANYWHERE.
These steps were needed :
-configure firewall of the router to which zoneminder is connected ,in order to do port forwarding :
WAN : 443 => 192.168.xxx.xxx (zm ip adress) : 22
-install 'NTLM Authorization Proxy Server' on client pc. , then just connect your client terminal (ex. putty) from whatever wan adress to the wan address of your zm installation ON PORT 443 !
This is the package you need : http://ntlmaps.sourceforge.net/
4. Alarm reporting over cellphone (sms),or regular 56k modem : still need to do :
27/12/2007 update :
Found it : I'm gonna use gnokii : http://www.gnokii.org/
More details will follow for install guidelines and usage ...
06/01/2008 update :
More details here :
http://www.zoneminder.com/forums/viewtopic.php?t=10976
5. Motion detection input from external motion detectors (X10) : still need to do
6. https enabling ... (I'd prefer all of this would work over an secured http connection)
7. Alarm triggering towards an external source (relay,alarm central,etc.)
26/12/2007 update :
Found a controller board which might enable me to achieve this : Arduino
More details in this thread : http://www.zoneminder.com/forums/viewto ... f9b88250fd
8. Audio recording : this could be achieved using feature 7 ,here above.
31/10/2007 update :
Here are already some of my findings ,on how get audio streaming+recording started : http://www.zoneminder.com/forums/viewtopic.php?t=10607
9. Webalizer for web site statistics

Code: Select all

install webalizer : sudo apt-get install webalizer
add webalizer to crontab :
sudo crontab -e
0 * * * *  webalizer -t TEST -o /var/www/webalizer /var/log/apache2/access.log
Now you can access the statistics on you zoneminder access on http://hostname/webalizer (were hostname is you ip adress ,or hostname of your zoneminder machine)

more on webalizer :
http://fontignie.blogspot.com/2006/04/i ... er-on.html
http://linux.die.net/man/1/webalizer

10. setup smtp server for sending mails trough zoneminder
24/10/2007 update :
Tried to install estmp ,to use gmail smtp server ,but can't get the darn stuff working. I must face it : I'm a noob in linux mail setup. :oops: . I would appreciate some help on setting up email from scratch on ubuntu.
Used this guide : http://ubuntu-tutorials.com/2007/07/08/ ... mta-esmtp/
27/10/2007 update :
Forget about the estmp stuff ... I forgot the most important rule in IT : simplicity
I just had to fill in trough the GUI ,in the field ZM_EMAIL_HOST (options,email) the name of my provider's smtp server (smtp.xxxx.xxx) .
And in the field ZM_FROM_EMAIL ,an email adress ending with my provider's location ( blablabla@xxxxxxx.xxx ).
26/12/2007 update :HOWEVER , postfix should be installed

Code: Select all

apt-get install postfix
11. System monitoring : very important for first installs,to see if your system can coop with the load.
27/10/2007 update :
Munin : http://www.ubuntugeek.com/monitoring-se ... buntu.html

Straight forward install ,just follow the guidelines in this link here above.

It can monitor :
cpu,eth,disk,mysql and much more ...
12. Get mpeg streaming to work : (just for finishing touch ,not really needed)
03/11/2007 update :
on ./configure some libraries seem to be missing :
WARNING: libavutil.a may be required for MPEG streaming
Those might be needed if accessing from a flash client.

13. [New 26/12/2007 update :] : Backup,Restore,Redundancy,UPS

UPS : http://www.zoneminder.com/forums/viewtopic.php?t=10897
I'll create a new thread for this one ...





I'll keep you posted about my findings ..

Kind regards,

K. :lol: :lol:
Last edited by ktheking on Sun Jan 06, 2008 3:20 pm, edited 44 times in total.

PeterHoward
Posts: 319
Joined: Thu Jul 20, 2006 1:07 am
Location: Australia
Contact:

Post by PeterHoward » Mon Oct 22, 2007 2:40 am

ktheking wrote:Zonerminder version : 1.22.3

Problem 3 :when user authenticating enabled ,streaming stops working.

Already discovered this in apache error log ( /var/log/apache/error.log) : Error, unable to authenticate user
It comes down to this : http://www.mail-archive.com/ubuntu-bugs ... 18717.html
So the problem lies in the .deb package made available by Peter Howard (for which many thanks ..). This package needs to be reworked ,so that it incorporates the package 'libssl-dev'. (this might also come from the fact that openssl is installed in one of the packages of the medibuntu ,which was installed after the install of zoneminder).
One of these days I'll actually have funds to get my main server going
again and I can chase down this #$@#$!@#$%!!! authentication bug :?

However . . .

One of the constraints on the .deb is that it needs to be suitable for Debian as well as Ubuntu (so I don't have to manage 2 variants). As far as Debian is concerned there a licensing issues with OpenSSL, hence Zoneminder depending on gnutls instead.

(http://en.wikipedia.org/wiki/OpenSSL#Li ... tibilities gives an overview of the issue)

I've looked back through my email archive and found I had questions back about how the authentication in ZM works wrt SSL authentication back in Feb, which I never followed up. I.e. if someone were to ask me how the authentication stuff works, my answer would begin with "um, . . . " and end pretty soon after.

Which means the answer for the package isn't quite as simple as (re-) linking against openssl. However, given I never chased this in the first place the answer may be pretty simple once I do look at it.

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle
Contact:

Post by cordel » Mon Oct 22, 2007 7:56 am

Peter, You might check and see what provides the md5.h file for the Apache build, you should be able to link to the same file as well and simplify the build so that you are not adding another requirement.

ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post by ktheking » Sun Oct 28, 2007 12:25 pm


mrd
Posts: 255
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd » Sun Oct 28, 2007 1:22 pm

Did the authentication issue ever get resolved?
Just curious...
MRD

ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post by ktheking » Sun Oct 28, 2007 1:58 pm

Yes. With installing the ZM from scratch did indeed resolved it.
However a collegue of mine did also an ZM install based on the .deb guidelines in some previous posts of this forum thread .

BUT : He didn't followed part2 of the guidelines of Lee Sharp.
And for him this worked prefectly !

Sooo : In one of the procedures of the step 2 ,there is an update done of the OpenSSL which is included in the .deb package. This is messing up the SSL.

conclusion : Do not update openssl once ZM is installed. (so closely check if when installing new packages if openssl update is included). -please correct me if I'm wrong -

Surely there must be a way to re-configure ZM to use the new SSL ,but I can't tell you how . :oops: (If anyone knows ,please be my guest to add a little description on how to ...)

K.

mbinstok
Posts: 1
Joined: Sun Oct 28, 2007 1:54 pm

Post by mbinstok » Sun Oct 28, 2007 2:53 pm

Hi, I'm having the same problem with user authentication !

When I enable ZM_OPT_USE_AUTH, I'm not able to see the video streaming anymore. If I disable it it works fine..

Also noticed the:
Error, unable to authenticate user

in:
/var/log/apache2/error.log


The configuration here is an Ubuntu 7.10 Server configured as per:

http://www.howtoforge.com/video_surveil ... der_ubuntu


I need to make user authentication work...
Is there anything I can try ?

Thanks a lot for your help !!


Mike
Buenos Aires - Argentina

mrd
Posts: 255
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd » Tue Nov 20, 2007 3:03 am

I'm having trouble getting ZM to stream using swf. I've matched my settings from an older install from a liveCD and still can't get it to work. I'm thinking it has somehting to do with ffmpeg? I see that it's there, but is it really installed and working?

root@system-z:~# ls -l /usr/bin/ffmpeg
-rwxr-xr-x 1 root root 74012 2007-01-28 17:48 /usr/bin/ffmpeg

I've also been having trouble with authentication. I did the install as instructed in the original post wihtout any of the directions from Lee Sharp and experianced the issue. I'll try another install without the aptitude update and see what happens.

Any help would be great.
MRD

ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post by ktheking » Tue Nov 20, 2007 5:45 pm

Better check these threads :

Flash/SWF generation to view events :
http://www.zoneminder.com/forums/viewtopic.php?t=8071

Flash streaming with live cd :
http://www.zoneminder.com/forums/viewtopic.php?t=7041

mrd
Posts: 255
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd » Tue Nov 20, 2007 6:51 pm

Unfortunatly, both of those posts are full or replies from me, so they aren't any help. I've had swf streaming working on my other systems, but there just seems to be something missing with ffmpeg in the ubuntu package.
MRD

PeterHoward
Posts: 319
Joined: Thu Jul 20, 2006 1:07 am
Location: Australia
Contact:

Post by PeterHoward » Tue Nov 27, 2007 4:11 am

mrd wrote: I've had swf streaming working on my other systems, but there just seems to be something missing with ffmpeg in the ubuntu package.
Yep. The package, as I built it, does not have ffmpeg support. I suspect I've put something in which makes it look like it is, but it isn't.

As to authentication, yep again; I stuffed it in the original packaging process. Unfortunately fixing it (and still not using openssl libraries for licensing reasons) is non-trivial. I've started dealing with it but it will take time.

PJH

mrd
Posts: 255
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd » Tue Nov 27, 2007 2:16 pm

I'm sure everyone is glad to hear you are starting to work on it. I just wish I could help :-)

Having an Ubuntu package to install a full ZoneMinder system is absolutely priceless!

Thank you so much for your work on this.

P.S. I can certainly be a tester if you need someone to try out installs.
MRD

ktheking
Posts: 70
Joined: Fri Oct 12, 2007 11:53 am

Post by ktheking » Thu Dec 27, 2007 1:07 pm


Beofres
Posts: 32
Joined: Tue Jun 19, 2007 6:53 pm
Location: North-Bay , California
Contact:

Post by Beofres » Mon Feb 04, 2008 7:50 pm

ktheking wrote:Zonerminder version : 1.22.3
Ubuntu 7.10 Feisty : Alternate version (command line)
.....
I followed ktheking's guide to install ZM on 7.10 Alternate, and it works perfectly on Xubuntu 7.10 Desktop.

Mpeg streaming doesn't work though, and hashed http authentication was finicky for the first hour, but *seems* to be working now.

Hope this helps.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest