Here’s my Zoneminder 1.23.3 install log. I put together this HOWTO so I could share the method I used but I mainly took the notes for when I want to know how to install zoneminder on Ubuntu 7.10 again. I’m sure it’s incomplete. Look at the documentation at the official web site for more help. By the way, for those who don’t know, Zoneminder is a video security surveillance system that runs on Linux and provides web access and automatic motion-detection with unlimited cameras. All you need is cheap cameras, and a decent computer. More information on Zoneminder is available on http://zoneminder.com. Also see this page, although for my situation, some of the tweaking described there was unnecessary. And this wiki has a good explanation of how to set up MYSQL for zoneminder
HARDWARE
I’m using a bttv card, real cheap on ebay, for a capture card. 4 ports on it. I think it’s bt878. My computer is a 3 GHz sony vaio desktop. Basically I just plugged in the capture card, removed the modem, and connected my monitor and keyboard, along with the network cable. . . Let’s move on . . .
INSTALL SERVER OPERATING SYSTEM:
Install Ubuntu 7.10 - Server Edition
You will need “LAMP SERVER” and “SSH SERVER” when you install your ubuntu server.
After installing the basic server, I went ahead and installed ubuntu-desktop. I intended originally to use this machine as a Desktop as well as a server, so:
$ sudo apt-get install ubuntu-desktop
LAMP stands for Linux, Apache, MYSQL, and PHP. Those are pretty good abbreviations. I suggest everyone know what they stand for. MYSQL is a database server. Zoneminder uses a MYSQL database. When installing the LAMP option you will be asked to create a MYSQL root password. Write that down. You are going to need it later to create MYSQL a login for Zoneminder.
-Later I disabled startup of X, for a headless system. See instructions later in this document.
INSTALL ZONEMINDER
This is how I got it:
Download and install a necessary library (alt link)
and
the zoneminder package for ubuntu 7.10 (alt link)
–Note: You have to do the following to configure Apache properly for Zoneminder:
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
SET UP NETWORK
Then I set up my network using the ubuntu gui network applet. I’m sure there’s an easier way, but I simply set up a static IP address (google “local IP addresses” for more info) and for gateway I put in the local address of my DSL modem (router) which happens to be 192.168.0.1 Commonly your netmask will be 255.255.255.0.
I set up OPENDNS on my server too, by following the instructions here:
(link)
PORTS for HTTP AND SSH
One action I recommend is to set up apache to listen on a custom port. In my Ubuntu 7.10 I did it this way.
$ sudo nano /etc/apache2/ports.conf
–write the port you want to use instead of port 80, which is the traditional port for a webserver. If your server is not to be used by the entire Tubes, which is true in my case as it’s a private video surveillance box, you can avoid not a few script-kiddie-type attacks by locating your server off the beaten path so to speak.
Here’s what my /etc/apache2/ports.conf looks like:
Listen 31290
<IfModule mod_ssl.c>
Listen 443
</IfModule>
While you’re at it, you might as well tell your ssh server to listen on a custom port as well, thus avoiding lots of potential attempted logins from script-kiddies and hackers all over the Tubes.
$ sudo nano /etc/ssh/sshd_config
Just place the port number you wish to use after the word Port under where it says “# What ports, IPs and protocols we listen for”
Mine says:
Port 32644
Leave the rest of the stuff alone in there and save the file.
PORT FORWARDING -
My server is behind a NAT router, otherwise known as an Actiontec GT701-WG DSL modem. To make the server available to the Tubes, it will be necessary to forward http traffic from the internet directly to the server machine on my network. This sounds difficult but is really easy and can be done through the router or DSL modem’s web configuration interface. Simply log in and go to the page where you get to forward ports. Then forward ports. Since everyone’s router is different, and since if you don’t have a NAT router, I will leave this part up to you. If you have trouble, google the model name or number of your router, along with “forward port” and you will find some helpful information.
CONFIGURE DYNAMIC DNS -
This is so that users can always access your server using a url instead of an IP address which is dynamically-updated and may change, thereby rendering your server inaccessible.
To configure my dynamic DNS entry I first created an account at dyndns.org. See
https://www.dyndns.com/support/kb/using_ddclient_with_dyndns_services.html
I set up a hostname such as myubuntuserver.dyndns.org under “host services” and chose “Host with IP address”
Then I entered the external IP address of my server. Once this account was set up I ssh’d into my server and -
Install ddclient
$ sudo apt-get install ddclient
–debconf attempts to configure using wizardry in the install script. If your zm server is connected directly to the Tubes, you can fill in the blanks as you go along and the resulting /etc/ddclient.conf file will most likely be effective. However, I discovered a web-based configurator at dyndns.org which helped by generating a suggested /etc/ddclient.conf(Wizardry again, but pretty well done.)
Here is the resulting /etc/ddclient.conf - you can use it if you replace the email address, PASSWORD, and LOGIN, and the hostname near the bottom. This works for me. My server is behind an actiontec DSL modem/router.
## ddclient configuration file
daemon=600 # check every 600 seconds
syslog=yes # log update msgs to syslog
mail-failure=whoever@gmail.com # Mail failed updates to user
pid=/var/run/ddclient.pid # record PID in file.
## Detect IP with our CheckIP server
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
## DynDNS username and password here
login=LOGIN
password=PASSWORD
## Default options
protocol=dyndns2
server=members.dyndns.org
## Dynamic DNS hosts
myhost.dyndns.org
DISABLE X
I discovered that due to an unknown memory leak, I got freezes of my whole machine - first firefox crashed, then X. Workaround! Disable X! I decided to place this server upstairs in another part of the building for security, anyway, so using it as a Desktop box is not going to happen, and I don’t need to figure out why it broke.
As recommended on ubuntuforums.org to set “Do not run Xserver at boot” - I did this-
$ sudo mv /etc/rc2.d/S30gdm /etc/rc2.d/D30gdm
$ sudo /etc/init.d/gdm stop
to shut down the X server
Wow! With no X-server running the load average dropped from upwards of 1 and sometimes 9 to less than .4! Zoneminder works great!
AFTER INSTALL
You access the control panel with a browser- at http://localhost/zm or replace “localhost” with the IP address of the Zonealarm server. You probably should set up your Zoneminder to use authorization - users will have to log in to see or use the system. The second system option, ZM_OPT_USE_AUTH found under “Options” will allow you to set that up. Please remember to have your password memorized before turning this on. I FORGOT mine, and it was a good thing that I remembered my MYSQL password, so I could reset the Zoneminder password.
Addendum:
Until recently, I had not discovered why my monitors would not properly display camera output at 640×480 resolution. I found recommendations to increase shared memory size. Check here for how. But remember to reboot. And reboot after setting the resolution in your Zoneminder monitor to 640×480. The “ipcrm” command is supposed to be helpful for this but a reboot did the trick for me.
Please feel free to comment below here. Your thoughts are welcome.