So here at the home front (our office), we've been having some strange goings on. Apparently students hold grudges against teachers that award grades fairly (that is, you get the grade you earn). So someone has been doing heinous things to teachers belongings and helping those things to go periodically missing, forcefully adjusted, etc.
Knowing that we can video record here in the USA without a warrant or legal cause to do so, we decided to setup a zoneminder system. For those of you who do not know, Zoneminder is a Linux based, open source CCTV system. One can setup a camera on the computer, set up Zoneminder, setup the camera in Zoneminder and VOILA! A Closed-Circuit TV system is up and running at a whim!
Unfortunately, ZoneMinder (ZM) doesn't really have all that cohesive of a tutorial system. People have just assumed several steps in what needs to happen, which causes problems. I'm going to put up a quick tutorial here that shows you some things that you need to know to be able to run ZM with little difficulty.
First, you need linux. I highly recommend debian for this install as you can run a debian netinst and really parse down your install. I don't like having too much more than I need on an install, so there is less to go wrong.
Download debian netinst from here. Burn it to a Disc, and boot from that disk. (I am, of course, assuming that you're building a computer purely for zoneminder.)
When you install, install only the core system and web server. To do this you'll need to unselect the desktop environment, you won't need it anyway, and select the web server. You can do this step later if you forget.
After that's done running, you'll need to do some fun stuff.
First, log in as root and run:
apt-get install sudo
(this will install sudo on your system.)
Then you'll need to run:
edit your sudoers file to add in your primary user name.
(usernamer) ALL = (ALL) ALL
CRTL-X will get you out of this, save it without the .old or .tmp extension
This will allow you as the primary user to run commands through SUDO. This is preferred over running everything as root. A Little harder to totally mess things up, and a little more secure.
Great, now that your primary user is a SUDOER, log out of root (CRTL-D) and log back in as your primary user.
Ok, you're going to edit your sources.list like this:
sudo vim /etc/apt/sources.list
if you're not familiar with vim, you need to hit 'i' in order to edit the text.
change every "etch" reference to "lenny" and add "contrib non-free" to the end of every line that you edit.
hit ESC, then the colon key (:) then type "wq" at the prompt and hit enter. This will close you out of vim, and get you going.
sudo apt-get update
This will take a little bit, so hit ALT-F2 to go to a different terminal "window," and log in there.
In this window, you'll want to download the .deb file for zoneminder. Unfortunately zoneminder is not supported in lenny, so you'll have to get the sid version. This worked just fine when I did it and turned out a fairly stable system.
Here's how to download from the command prompt.
First, on another computer (easiest) go to the zoneminder package mirror page which can be found here.
Select a mirror that you want to use and type:
That's just an example, you can use any of the mirrors from the main debian page.
Back to terminal 1 while that's downloading (ALT-F1)
If it's done downloading the repository indicies, good, otherwise just wait a moment. Then type:
sudo apt-get upgrade
wait a while
sudo apt-get dist-upgrade
It's annoying and time consuming, but really worth your while. While that's running, go have a cup of tea, or something. Come back and reboot your computer. It'll be stable and ready to go!
Next, you'll need to install a lot of stuff, so hold on to your shorts and get ready to apt-get your way into bliss!
Run the following commands:
sudo apt-get install mysql-client mysql-server php5
sudo apt-get install php5-mysql libapache2-mod-php5 libapache2-mod-auth-mysql
sudo apt-get install ffmpeg
Running those commands will get you on your way. Most of what you need would be picked up by dependencies in the zoneminder package, but that's no big deal for now. Just let it run.
Now, while that's running, check on your second terminal. ALT-F2!
If your zoneminder package has successfully downloaded, just go have another cup of tea. Otherwise try re-typing the url or try a different mirror.
When it's downloaded, exit out of that terminal, you'll not need it anymore.
When apt-get has finished it's jovial run through the trenches, you'll need to run:
sudo dpkg -i zoneminder_1.23.3-3_i386.deb
It will complain about being broken, but just tell it to stop complaining in your favorite vernacular and run:
sudo apt-get install -f
It'll install a whole pile more of packages, and you'll get to watch apt-get do its magic one more time.
Now, make sure apache knows what it's suppose to be doing by typing the commands:
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
this will let your web server know where to find the information about zoneminder.
Relax, you're almost done! (Doesn't it feel great?)
sudo apt-get install module-assisstant
That'll install the Kernel module assistant, which is a really snazzy piece of work!
sudo m-a prepare
sudo m-a update
It'll download and install some stuff to get you rolling. Rolling downhill that is!
sudo m-a a-i gspca
sudo modprobe gspca
That will install the drivers (most likely) for your webcam. If your webcam is not supported by these drivers... uhm... get a different webcam. (sorry!)
Reboot your computer. You can restart all the services manually, but rebooting is easier.
Ok, the moment of truth. Run:
sudo zmu -d /dev/video0 -q -v |less
What this will do is let you know what the statistics are for your webcam. This is probably one of the most important steps of getting all things running. You'll need some of these numbers, or you'll have a hard time getting that camera to show up. Piping this through "less" will allow you to scroll up or down while you're reading the info.
Now, log into zoneminder with your other computer. Type in the ip address of the zm machine and type /zm.
This will bring up (hopefully) the zm console for you. Click "add monitor"
Using the information you gathered from zmu -d, tell zoneminder what your camera is expecting to send out to the world. If you don't tell zoneminder what the camera is expecting, it will not work.
Make sure you set the camera to monitor and make sure it's activated.
I'm sorry not to have gone into more detail after you have zm up, but I think that the final stages are probably the most documented of all the steps. If you need any help with this, post a comment and I'll try to help you out if I can!