Changing Image/events directory to another location!

Support and queries relating to all previous versions of ZoneMinder
Locked
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Changing Image/events directory to another location!

Post 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.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Post 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?
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Post 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


?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

zm should be running the same user and group as apache so the folder should be the same.
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Post 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

?
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Post 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?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
metallica1973
Posts: 100
Joined: Sat Aug 23, 2008 8:03 pm

Post 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.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
koblow1973
Posts: 7
Joined: Sun Aug 31, 2008 6:02 pm

Post 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.
eug
Posts: 32
Joined: Wed Mar 14, 2007 5:50 am

Post 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
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Actually it is if you just use zm auth by it self.
Locked