Installing ZoneMinder from Kubuntu 8.04 Step by Step

Support and queries relating to all previous versions of ZoneMinder
ShoeDad
Posts: 3
Joined: Fri Aug 01, 2008 10:17 pm

Installing ZoneMinder from Kubuntu 8.04 Step by Step

Post by ShoeDad »

Before installing anything, update motherboard bios if possible

Install KUBUNTU (current version is 8.04)


Reboot Computer

From Desktop click on K>>System>>Console

sudo nano /etc/apt/sources.list
uncomment all 'deb' lines

Ctrl-X to save

sudo apt-get update

sudo apt-get upgrade

sudo apt-get update

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

Install Webmin
sudo wget http://prdownloads.sourceforge.net/weba ... 70_all.deb

sudo dpkg -i webmin_1.370_all.deb
(note address to access webmin https://computername:10000/)

Install PHP MYSQL APACHE2
sudo apt-get install apache2 mysql-server php5 php5-mysql libapache2-mod-php5

set password for mysql root user

Check to See if everything installed correctly

CONTROL APACHE
Start --> sudo /etc/init.d/apache2 start
Restart --> sudo /etc/init.d/apache2 restart
Stop --> sudo /etc/init.d/apache2 stop

if you get an error message
apache2: Could not determine the server's domain name, using 127.0.0.1 for ServerName

then
sudo nano /etc/apache2/apache2.conf
add--> ServerName 'localhost' to the file

CONTROL MySQL
Start --> sudo /etc/init.d/mysql start
Restart --> sudo /etc/init.d/mysql restart
Stop --> sudo /etc/init.d/mysql stop

Set root password for MySQL

from terminal prompt: mysql -u root


from mysql prompt:
set password for root@localhost = password('password'');
flush privileges;
quit;

TEST PHP
Create a new file called test.php at this location /var/www/test.php (will need to change permissions to be able to create file)

from Terminal:
cd /var
sudo chmod 777 -R /var/www
sudo nano /var/www/test.php (enter the following into the file)

<? phpinfo(); ?>
Ctrl-X
save Y

open web browser and enter in the address bar
http://localhost/test.php
Install ZoneMinder
sudo apt-get install zoneminder

zoneminder is installed at /usr/share/zoneminder we will need to redirect apache2 to know that zoneminder isn't located at /var/www/zoneminder

https://yourcomputername:10000
enter user and password

WebMin is launched
Click Servers
Apache Webserver
Existing Virtual Hosts tab
Default Server
Aliases & Redirects
Document directory aliases

/zoneminder /usr/share/zoneminder

Click Save


Restart Apache2 from terminal:
sudo /etc/init.d/apache2 restart

Change some permission settings:
sudo chmod 4755 /usr/bin/zmfix
sudo chmod 666 /dev/video*

Install FFMPEG
sudo apt-get install ffmpeg

Install Firefox Browser (do not want ver 3 yet)
K>>Add Remove Programs>>Internet>>FireFox2

Launch FireFox
From the address bar type:
about:config

Find network.http.max-connections double click and change to 100
Find network.http.max-connections-per-server double click and change to 100
Find network.http.max-persistent-connections-per-proxy double click and change to 100
Find network.http.max-persistent-connections-per-server double click and change to 100

Everything should now be installed need to launch ZoneMinder and add monitors

http://localhost/zoneminder
change bandwidth to high

Need to make two changes to the scripts to allow mpeg video exports

Create generate_movie file
cd /usr/share/zoneminder
sudo nano generate_movie

Contents of generate_movie

#!/bin/bash
rm -rf temp/frames 2> /dev/null
mkdir temp/frames

cat $1 | sort | grep -i capture > temp/zmSortFileList.txt
cat temp/zmSortFileList.txt | grep -i capture | while read n
do
i=$(($i+1));
j=$(printf “%07d\nâ€
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

Talk about overkill... While that will work, it can be easier.

First, there is no need for webmin.

Second, installing the zoneminder deb installs apache, and sets up PHP.

Third, the repo version is out of date, and you can get newer ones that are current from Peter. The mods that are needed are in the readme, or on the wiki.
ShoeDad
Posts: 3
Joined: Fri Aug 01, 2008 10:17 pm

Post by ShoeDad »

Yep, I'm sure there are many thousands of ways to do this easier. But, being new to Linux and Zoneminder, this is the only way we have consistently got it to work the same every time we've installed. We've scoured the forum and wiki for problems that we've seen and have usually ended up at the same place, scrapping the system and re-installing.

Issues such as not being able to export mpeg, not getting a picture to show up on the screen, being able to see the picture on the screen but notice that it isn't recording, events not clearing out when the drive starts to become full and a few others I can't remember right now. I don't have time to constantly tweak software, so I need something that will work the same every time I install it....this is the ticket for us right now. I know there are newer better patches, or software released but I'll let someone else be on the "BLEEDING EDGE" of technology. The only thing we have left to do now is figure out how to make the live videos bigger without making everything crash.

I've asked everyone named Peter that I've come in contact with about Zoneminder....they just gave me the deer and headlight look. So getting something from Peter has not been successful.......I guess it might help if I knew who Peter was. We've tried version 1.23.22 but we've had the above problems.
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

I thought all the Peter's knew each other... Silly me. :) But right of the download page is this link.
ftp://www.northern-ridge.com.au/zoneminder/
He is the package maintainer for Debian, so you are using his old package.

As to the repeatability, that I why I wrote the .deb portion of the Wiki. If you do those steps, it will work every time.

However, I am working on some new advanced steps for the server as a view only console with auto-login to a powerless user. Yes, it will be nice. No it is not as easy as I thought it would be!
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

when I hit export, I have this error:

Warning: opendir(media/cam/FrontDeskFront/49934) [function.opendir]: failed to open dir: No such file or directory in /usr/share/zoneminder/zm_export_funcs.php on line 198

Warning: fopen(media/cam/FrontDeskFront/49934/zmEventDetail.html) [function.fopen]: failed to open stream: No such file or directory in /usr/share/zoneminder/zm_export_funcs.php on line 215
Can't open event detail export file 'zmEventDetail.html'

I should note that I have a separate partition where the data is stored, mounted as /media/cam/
What do I do? thanks
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

What is the full path to "media/cam/FrontDeskFront/49934" and is it under the web server root path?
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

That is the full path ---- do you mean is the ownership root?

root@camserver:/media/cam# ls -l
total 156
drwxr-xr-x 404 www-data www-data 20480 2008-08-12 15:30 1
drwxr-xr-x 404 www-data www-data 20480 2008-08-12 15:30 2
drwxr-xr-x 404 www-data www-data 20480 2008-08-12 15:30 3
drwxr-xr-x 408 www-data www-data 20480 2008-08-12 15:30 4
drwxr-xr-x 404 www-data www-data 20480 2008-08-12 15:30 5
drwxr-xr-x 404 www-data www-data 20480 2008-08-12 15:30 6
drwxr-xr-x 403 www-data www-data 20480 2008-08-12 15:30 7
drwx------ 2 www-data www-data 16384 2008-06-18 08:24 lost+found

that's what I get.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

So do you have a soft link from media in your web root to the partition or have you configured apache in any way to have that partition as part of your web root aliased as media?
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

I suppose the former; i symlinked /events/ to /media/cam but I'm sure I've done it incorrectly (the PurgeWhenFull Filter doesn't work, so I've been using a cronjob to delete files).

If you were told to install ZM on a machine with a small hard drive, what would you do? I added a second HD, partitioned it into linux on one side and the camera data (images and events) on the other. Is that bad? What would you do to prepare it? Symlinks? This must be the root of my problem.

thanks!

see

http://www.zoneminder.com/forums/viewto ... highlight=
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

First check your apache config and make sure you have in your options to FollowSymLinks directive. should look something like:

Code: Select all

DocumentRoot "/var/www/html"
<Directory>
    Options FollowSymLinks
    AllowOverride None
</Directory>
This will allow apache to follow the symlink. But if your purge filter is not working then there is some thing else as well to be concerned about as zmfilter and zmaudit don't need that directive to access the symlink.

What do you get if you ls -l to the symlink?
Does the symlink have rw for the apache user?
What do you have configured in zm for your events path?
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

httpd.conf is empty (located at /etc/apache2/httpd.conf). Any ideas?

root@camserver:/usr/share/zoneminder/events# ls -l
total 0
lrwxrwxrwx 1 root root 10 2008-06-18 16:57 cam -> /media/cam
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

The thing is, everything else works. I can see the video, and the files ARE created. So apache/zoneminder must have rw for the symlink, right?

If you need to spell things out for me, please do. my knowledge here is limited.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Well if you have the path for the events directory set in ZM to go directly to the partition, then zma will write files directly to the partition with out the use of the symlink, likewise for zms, the only thing where the symlink would fail in this case would be still images, and any functions being performed by Apache through the php script like your export problem, although there are a couple things that don't seem to add up as Apache should have a config file somewhere, if it's not in /etc/apache2/conf/ then will likely be spread out in /etc/apache2/conf.d over a few files or something similar.

Just make sure you make a backup of anything before you open it in an editor as no one likes Murphy to much.

So what is you event path set to in ZM?

You do have at least two separate issues here.
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

I have a zoneminder.conf file under /etc/apache2/conf.d/ but i do not have an /etc/apache2/conf.d/httpd.conf.

the output of zoneminder.conf:

Alias /zm /usr/share/zoneminder

<Directory>
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule>
DirectoryIndex index.php
</IfModule>
</Directory>
yochaigal
Posts: 41
Joined: Wed Jun 25, 2008 1:55 am
Location: San Francisco

Post by yochaigal »

My event path is /media/cam/ although I just changed it to be that, it used to be /events/cam/ I believe.
Locked