Files
hpr-knowledge-base/hpr_transcripts/hpr0286.txt

261 lines
18 KiB
Plaintext
Raw Normal View History

Episode: 286
Title: HPR0286: Zoneminder Install
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0286/hpr0286.mp3
Transcribed: 2025-10-07 15:35:03
---
So
Hello and welcome to this episode of Hacker Public Radio.
This is the Yelkey Man that's coming at you, and today I'm going to be talking about
Zone Minder, a little bit of backstory on my Zone Minder setup.
I work at an educational institution, and in one of the rooms specifically at our
educational institution, the teacher office, the main teacher office, the things had been
happening strangely, you know, stuff had been moved around, there had been just a little
bit of vandalism, you know petty stupid stuff, but it was getting to the point where some
of the teachers were not feeling safe to leave stuff in there, and rightly so a cell phone
had been stolen, so we thought about putting up a webcam.
We have plenty of webcams available at our disposal, so we thought, hey, we'll just put up
a webcam and record it and see what happens, and two hours later and something like three
gigabytes of data that wouldn't be opened by any of the programs that we have, we realized
that we needed a new solution, so I suggested setting up a, one of our broken laptops that
we have a lot of laptops with cracked screens, they're fine otherwise I said, why don't we
set up one of our broken laptops with the Linux distribution and, but a boom, but a
bang, hey, we have a Zone Minder machine.
Well, turns out it's not quite that easy, but almost, so the first thing that I did is
I checked out to see if there's any live distributions that have Zone Minder already installed,
and well there is, there's the Zone Minder live, well it's based on Mandriva, which in my
experience has not been that great with on, let's say, non-standard software or hardware,
like that.
So it's based on Mandriva, and I installed it on the little laptop and we were running
Lenovo 261, very popular laptops, and it took me, I think eight or nine times of trying
to install this, to get it to actually install, and then once I got it installed, I couldn't
run the updates, it would stat the repositories and then time out and then crash, and then
I'd have to reboot it.
But I finally got Zone Minder to operate with the little USB webcam that we had, and we
put it up in the ceiling and hooked it up to the network, and I thought, hey, this is
great.
I shut off the GUI interface and just was running, you know, command line, because you don't
need anything more than command line to run the web server and the Zone Minder, wow,
this is awesome, and it would work for about three hours at a stretch, and that was it,
and it's crash.
So that was annoying.
Finally, I said, forget it, I want to blow away this whole Mandriva live CD thing that
we had installed onto there, it was just terrible, it was, you know, supposedly quote, unquote,
the recommended distribution for running Zone Minder in a hurry, but I ended up spending
about two weeks trying to get this thing to work correctly and it just never did.
So here is what I did do to get it to work and to get it to run correctly.
And if you want to set up your own little Zone Minder thing with a webcam, this all should
work.
And there's a couple of things that I'm going to mention that I didn't find on too many
tutorials.
Actually, I didn't find out any tutorial, I had to kind of figure it out for myself.
Step number one.
I want to download a copy of the Davian Net Inst.
And that really is just your basic, basic, basic Davian.
And what I did is I said, okay, install a web server and the core utils and the laptop
utilities.
And that's it.
I don't want you to install anything else, just install those things because, well, you
need the core utils.
This is a laptop and I'm going to be running a web server anyway.
Now, you can always just install the core utils and then build up what exactly you want
to have on there.
But I thought, well, I'm not all that concerned.
Running essentially, I think the distribution ended up being two gigabytes.
No, it didn't even end up being that much.
On a 60 gigabyte hard drive that we were going to run one webcam off of.
So I wasn't all that concerned on parsing it down.
You can definitely parse it down if you run the Davian Net Inst.
So when you install, you just let it run.
And then you log in as root and run apt, get, install, pseudo because pseudo is not considered
to be a base package.
It doesn't come in automatically.
Now, you want to install pseudo for those of you who are not familiar with systems administration
because it's a bad idea to run things as root.
If anything happens to your system, it's a lot easier to really just total your system
as root than it is with the most pseudo distros.
A lot of times, if you're trying to mess with something too heavy, pseudo will give you
an error and say, well, no, you can't do that.
And then you can go and enforce it if you know what you're doing as root.
But anyway, after you do apt, get, install, pseudo or aptitude, install, pseudo.
You can run, vi, pseudo.
And that is vi, sudo, and that will open up your pseudo's file.
And you want to add in your primary username, tab, all equals, all in parentheses, space,
all.
And that will give you pretty much full privileges for the system.
So log out and then log back in as your regular user.
And you can just type exit or hit control D to log out and then you're in a log back
in as your regular user.
And if you want to do something as a super user, you just type in sudo, pseudo.
Now you're back into the system, you want to edit your sources dot list for apt, yet,
or aptitude.
Now I do, pseudo is the very first thing.
Some people say that you should update the sources list first, but this is the order
that I do it in.
It doesn't necessarily, I don't think matter, correct me if I'm wrong.
But you can do pseudo, vi, m, space, slash, etc, slash, apt, slash, sources dot list.
Now if you're not familiar with them, you'll need to hit i in order to edit the text, but
you're going to hit i and change every reference to etch to Lenny.
And then at the end of every line that you add, you're going to make sure that there are
the words contrib, c-o-n-t-r-i-b, and non-free, that's n-o-n, hyphen, f-r-e-e.
There's a couple of packages that you'll need to get zone-minder running that are only
available through the contrib and non-free, and actually one package that you just have
to get.
Now to edit out of them, you need to hit escape, the colon key, it'll bring up a little prompt
at the bottom.
My wq in lowercase letters hit end, enter, and bet a boom, bet a bang, it'll write it
and quit out of there.
Next step, type pseudo, apt, get, update, that's going to update your system, let your system
know where files are available in the new Lenny repositories.
And you're going to hit, while that's running, hit alt, f2, and that'll open up a new terminal,
just log in, as your regular user, of course.
You're going to download zone-minder, unfortunately, zone-minder is considered to be unstable, which
kind of is, it's still in very, very active development, so it's a little unstable.
But you're going to use the command wget, and then type in wget and point that to a mirror
that has the zone-minder deb.
The one that I did, it looks kind of like this, is wget, space, http, colon, slash, slash,
debian, dot, organ, state, dot edu, slash, debian, slash pool, slash main, slash z, slash
zone-minder, slash, zone-minder, underscore, one, dot, two, three, dot, three, hyphen, three,
underscore, i386, dot, deb.
Now that's a lot of stuff, and if you're trying to type that, as I said, you're probably
going to be saying, wait, wait, hold on, hold on, slow down, slow down, slow down.
And you would be right.
But if you check out on the hacker public radio page associated with this, you're going
to see a link to my blog, which has a link to the Debian mirrors page where you can pick
out the mirror that is closest to you.
I purposely kind of went through that a little quickly to encourage you to go to the Debian
mirrors where the zone-minder is, and pick out the mirror closest to you so that not
everybody's going to organ-state.edu and downloading the zone-minder file.
Back to Terminal 1, hit Alt F1, pop up Terminal 1, you should be done updating.
So now you're going to type sudo apt get upgrade, and wait, you can go to Terminal 2 and
check out the download process over there, see if it's still downloading.
If it's not downloading, you can try different mirror, try retyping it, do it how you want
to do it.
After apt get upgrade is done, you want to type sudo apt get dist upgrade, and this is
going to upgrade you to Lenny.
I used Lenny for a few reasons.
One, it's called, what was it called, testing, but most of the stuff in there has been tested
pretty well through the unstable branch, and it has to prove to be at least moderately
stable to go into Lenny, and it seems that running Lenny is a little bit easier to do
newer things like zone-minder, so you don't necessarily have to struggle as much.
I didn't really have to struggle at all to get zone-mider up and running.
So apt get dist upgrade, you're going to have to tell yes, hit the Y key, and then it
will start going and going.
So my recommendation is go make a cup of tea, drink the cup of tea, check on your computer,
see that it's still running, if it's still running, and then go back to your cup of tea
because it's probably still be running.
It takes quite a while to download and install everything that way, but it's well worth
your while.
You'll be up to date, all of your bug fixes will be installed, all of your security vulnerabilities
will be patched and up to date as much as they're going to be on Lenny, so that's pretty
good.
Okay, now that apt get is done running upgrade and dist upgrade, you want to reboot your
computer.
This will just put you into the new kernel so that the rest of the stuff that you do will
be associated with the new kernel because we're going to be adding a kernel module later.
Next you're going to install some stuff by hand, and you don't necessarily need to do
this, although I always feel better installing specific dependencies by hand, simply because
I'm not completely convinced that dependency resolution protocols are perfect, it's just
been my experience that sometimes if you install some core packages by hand, it seems to
go a little better.
What I did is I ran pseudo apt get install my sql hyphen client space my sql hyphen server
and space php 5.
This will install the base kind of tools for my sql and php, which is what zone might
it runs off of.
Then you're going to type pseudo apt hyphen get install php 5 hyphen my sql lib Apache
2 hyphen mod hyphen php 5 lib Apache 2 hyphen mod hyphen off hyphen my sql and hit enter.
That will install those packages in some dependencies and then the final one we're going to install
manually is pseudo apt get install ff mpeg and ff mpeg is dependent upon a whole bunch
of cool visual tools that zone might is going to require.
This shouldn't take you more than just a few minutes, but make sure you pop back to the
second terminal alt f2 to see if the zone might packages successfully downloaded, you're
going to need that in the next step.
Now when you're sure zone minders downloaded exit out of the second terminal you're not
going to need it anymore.
Go back to the first terminal and by now ff mpeg should be done installing and you're
going to type in pseudo dpkg space hyphen i space zone minder underscore 1.23 dot 3 hyphen
3 underscore i 386 dot deb or pseudo dpkg space hyphen i star dot db will be just as easy
as can be because right now the only deb file in that directory and then your home directory
is the zone minder one.
It's going to complain about being broken, that's fine.
Just let it keep running, it'll run, it'll tell you it's broken.
Now you're going to run pseudo apt hyphen get install hyphen f and there's some spaces
in there so it's pseudo apt get space install space hyphen f and what this does is it
tells apt get to install the fixes apt gets going to do it's magic it's going to go through
and it's going to pull in some libraries that you need and it'll be quite happy doing
that it'll it'll set up self up quite easily and there you go.
Now to get Apache to recognize zone minder and I'm not sure why any of the debutant distributions
don't kind of have this go automatically maybe somebody can can fill me in there but I'm
not sure why it's not automatic.
What you need to do is type pseudo space ln space hyphen s space slash etsy slash zm slash
Apache dot c o n f space slash etsy slash Apache 2 slash c o n f dot d slash zone minder
dot c o n f and what you're doing here is you're pointing your Apache web server configuration
file to the zone minder configuration file so that zone minder and Apache can talk back
and forth and Apache knows where zone minder is hiding.
You can do a pseudo slash etsy slash in it dot d slash Apache space force hyphen reload
if you want however I'm going to have you reboot the whole system at the end of this
process anyway because you're going to be installing a kernel module so don't bother
if you don't really want to.
If you're not running a USB camera if you're running a net based camera and you already
know how to get that running and it's already running you can do the force reload and then
you'll be good to go.
Now that kernel module that you're going to install you're going to be doing a pseudo
apt-get install module assistant and this is module hyphen assistant.
Now apparently I just learned about this when I was doing this process but the module
assistant helps you to resolve kernel issues installing kernel modules in a devian environment
or maybe even other environments I just know about it in a devian because I'm a devian
kind of guy.
Then you're going to run pseudo m hyphen A which stands for module assistant prepare
and that's going to run the module assistant preparation utility.
You're going to run pseudo m hyphen A space update which runs the update utility and
that's going to install some stuff so that module assistant can talk to your kernel and
install all the stuff it needs when it was installing I saw it installed the headers
and all kinds of cool stuff so that it can get going.
Now believe it or not this should probably take you around an hour hour and a half so
far and most of your time is spent running apt-get and the updates and the installations but
you're almost done so now you're going to run pseudo m hyphen A space A hyphen I space
G SPCA now G SPCA is the USB drivers for USB webcams these are typically the cheap
cams that you find at Walmart if you're running out to buy one for this I would recommend
obviously googling G SPCA and checking the hardware list to see which ones work best
which ones have the green rating and then get one of those ones as a green rating.
The one that we used is some ancient HP that our tech guy at school had sitting in a closet
somewhere at home he brought in and it worked wonderfully once I realized that the G SPCA
had the drivers for that specific cam.
Now that module assistant is done running for G SPCA you're going to type pseudo space
mod probe space G SPCA and this should stick all the kernel modules in for the webcams
that you need now reboot your computer and there you go a moment of truth.
Okay your computer is running you've got your new kernel up with your new kernel modules
and you are ready to go so the moment of truth you are going to run pseudo space ZMU
space hyphen D space slash DEV slash video zero space hyphen Q space hyphen V pipe and
that's the little vertical thing above the backslash key less this is the step that
I did not find in any tutorial anywhere this is the step that is the magical step in
getting your USB webcam to work because if your numbers aren't right when you install
the webcam it will just get angry at you and tell you to go fly a kite somewhere else.
So what you need to do is the less command will keep that on your screen and you can scroll
up and down through all the statistics about your webcam if your webcam supported by the
G SPCA then it will show up there now go on over to the zone-minder interface and that's
how you get that is by typing HTTP colon slash slash the zone-minder machines network address
slash ZM you can always make ZM your default if you want but I did not do that in my
tutorial simply to obfuscate the you know location of zone-minder just a tiny little bit but
anyway so for my example we'll just call it 192.168.1.94 slash ZM and it will bring up the zone-minder
console then you want to click add monitor when you click add monitor it will bring up the little
interface the second tab there is the one that you want to look at it's the one that has you
know the location the video type that you're going to be pulling in and your window size now
some of these webcams have extremely strange picture sizes and you have to get the maximum picture
size right if it's bigger than the maximum picture size where the proportions are not right I
discovered your webcam may not work so what I had to do was was use the ZM you command to find
out those details plug those details of the maximum size into zone-minder and it worked perfectly
my camera's configuration style believe it or not was like 351 pixels wide by 248 pixels tall
which is excruciating leap is our I don't understand that but anyway if you've got that all up
and running there are tons of excellent tutorials on what to do from here on out on setting up
zones on setting up alerts doing motion detection all those kinds of things this is just getting
the server up and running I I haven't heard any podcast on this I've heard podcasts on the
rest of it but this should get you up and running with usb webcam if you have any problems
you can just go on over to my blog uh yelke mantis dot log spot dot com again I'll be a link in
the show notes for this go over to my blog it's supposed to comment and uh if it's a problem that
I've come across I'll answer for you if if if I'm not come across that problem maybe somebody else
so we're at the blog can uh help you out so good luck happy zone minding and have a nice day
thank you for listening to Half Republic Radio
hpr sponsored by caro dot net so head on over to c-a-r-o dot anything for all of us