Page 1 of 1

Changing Image/events directory to another location!

Posted: Sun Aug 31, 2008 6:04 pm
by koblow1973
I have setup zoneminder and have it working great but the /var/www/html/zm/events and image directories are filling way up to fast and I want to tell Zoneminder to put any events or images in another directory that has alot more disk space like /home/test/zm/events. Everytime I go under zm/options/paths and change the directory and restart zm it does nothing. I read that you have to create a symbolic link to your new directory and then it will work but I have not had success. Any suggestions? In other words I want to store the stuff in another location.

Posted: Sun Aug 31, 2008 7:50 pm
by cordel
:arrow: Stop ZM
:arrow: mv /var/www/html/zm/events /opt or what ever your mount point is.
:arrow: ln -s /opt/events /var/www/html/zm/events
:arrow: Check the you can still view existing events both stream and stills. Other wise stop here and find your permission problem (check all your logs for errors, including Apache)
:arrow: Once the previous step works, start ZM.

Posted: Sun Aug 31, 2008 9:38 pm
by koblow1973
When I created the partitions I gave the home directory most of the disk space so

I created

ls -n /var/www/html/zm/events /home/bpshady2/zm/events

I gave the /home/bpshady2/zm/events

chown -R root:root /home/bpshady2/zm/events

chmod 755 /home/bpshady2/zm/events

I restart ZM and it still does not work. I also looked at the /var/www/html/zm/events and noticed that is has created several linked monitor directories 26,27,28,29 and etc.. I am still having trouble.

What should the permission be on the directories?

Posted: Sun Aug 31, 2008 10:30 pm
by koblow1973
It is most definately a permission problem. I checked the /var/log/messages and it says that it cant write to 26 directory which is under /events. I tried giving the directory ownership to apache and when that didnt work then to root. I also checked the /var/log/httpd/error.log and it says "df 'events 'permission denied' " error message. What should I set it too.

/home/bpshady2/zm/events

and

/home/bpshady2/zm/images


?

Posted: Sun Aug 31, 2008 11:25 pm
by cordel
zm should be running the same user and group as apache so the folder should be the same.

Posted: Sun Aug 31, 2008 11:57 pm
by koblow1973
I did a little digging and I tested the permission by

http:/localhost/zm/images

and I get the permission denied.

I checked the logs and it say that the symbolic link doesn't have permission to access /home/bpshady2/zm/events

?

Posted: Mon Sep 01, 2008 2:37 am
by koblow1973
I finally was able to fix the issue by following what you said and also changing the directive option in /etc/httpd/conf/httpd.conf

http://httpd.apache.org/docs/1.3/mod/core.html#options

but now I cannot see any events when I go under the event number. It doesn't display anything. I can see that the *.jpg are being stored under my new directory /home/bpshady2/zm/events but I am unable to view what event it has captured and it shows the duration of the event as 0:00. What else am I missing?

Posted: Mon Sep 01, 2008 6:08 am
by cordel
Sounds like you missed the last rule in my directions up top, you started ZM without having everything properly setup, zmaudit has come along and could not find any of the events so has deleted anything in the database that it could not match up to the drive.

Posted: Mon Sep 01, 2008 6:26 pm
by metallica1973
everything that you said I did with ZM stopped. This is a major design flaw with Zoneminder. Why would they make it so difficult just to save your data in another location. How idiotic.

Posted: Mon Sep 01, 2008 6:56 pm
by cordel
Actually it is this difficult because there are two different services at work here. ZM and the Apache web server so both must be configured. It's not really that difficult to do though and the above instructions assume that everything was configured correctly from the start.

Posted: Tue Sep 02, 2008 12:41 am
by koblow1973
Many thanks I got it working but I had to do some tweaking. I will explain in steps so that future hobbiest can get the picture.

1 - Assuming that you have zoneminder setup correctly and with a default installation of /var/www/html/zm

2 - Stopped ZM
mv /var/www/html/zm/events /home/bpshady2/zm/events or what ever your mount point is.
ln -s /home/bpshady2/zm/events /var/www/html/zm/events

3 - Check the you can still view existing events both stream and stills. You can do this by
going to the web browser and simply typing:

http://localhost/zm/events

and

http://localhost/zm/images

see if you get a 403 permission error accessing the directory. If so then
stop here and find your permission problem (check all your logs for errors, including Apache)

Looking into Apache I had to change option in the directive via

[url]http://httpd.apache.org/docs/1.3/mod/core.html#options[.url]

once the permission are set correctly you should be able to browse via the instruction above.

Once the previous step works, start ZM.

*** Key Note****

Dont forget that under filters(PurgeWhenFull) is not set by default and you have to tweak it to your satisfaction until you get the desired results. I set it to purge when the system reaches 50%. Also your Zones need to be tweaked so that the cameras are not recording everything when the cameras are set to modetect.

Posted: Thu Oct 16, 2008 4:29 am
by eug
koblow1973 wrote: 3 - Check the you can still view existing events both stream and stills. You can do this by
going to the web browser and simply typing:

http://localhost/zm/events

and

http://localhost/zm/images
I was moving my events folder when I realized that... anyone can just add /events to the url and see all my captured images. That can't be how it is, am i missing something? I could disable the directory listing, but people could try and guess paths...


thanks

Posted: Thu Oct 16, 2008 9:47 am
by cordel
Actually it is if you just use zm auth by it self.