Confused with paths

Support and queries relating to all previous versions of ZoneMinder
Locked
Jolaf
Posts: 14
Joined: Mon May 02, 2005 10:46 pm
Location: Bordeaux (france)

Confused with paths

Post by Jolaf »

The problem is that if I set ZM_DIR_EVENTS to : /var/www/html/zm/events jgp files are fine stored in a directory which is /var/www/html/zm/events/1/7/ (camera 1, event 7)
but the images web adress is : http://192.168.0.3/var/www/html/zm/even ... apture.jpg
whereas the gui web adress is http://192.168.0.3/html/zm/index.php
So I removed /var/www/ from ZM_DIR_EVENTS. but then no frames are recorded :( and disk occupancy (gui upper right corner) indicates -1%.

logs are clean except some perl scripts which die with signal 14

I dont know where to look to fix that annoying point.

[edit]
Add of my configuration

zm version v1.21.0 compiled on ubuntu, with bt848A chip, apache2, php 4.3.10, mysql 12.22.
The server adress is 192.168.0.3 and I use firefox 1.0.3 on a windows 2000 machine.


tnx for help and advices.

Jolaf'
Last edited by Jolaf on Tue May 03, 2005 12:15 pm, edited 1 time in total.
Ruler
Posts: 235
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

I can't say why 192.168.0.3/var/www/html--- works; apache shouldn't be allowing access to your entire file system.

Try http://192.168.0.3/html/zm/events/1/7/ as the address to access the images. Basically, /var/www (or whatever you set in httpd.conf) is translated into / when viewed through a web browser. You need to access the files and directories under that relative to the root web directory instead of absolute on your file system.
Jolaf
Posts: 14
Joined: Mon May 02, 2005 10:46 pm
Location: Bordeaux (france)

Post by Jolaf »

I must say I am not used to those apache/php/mysql... stuffs.

Howerver, I found the file /etc/apache2/sites-available/default
and I changed
- DocumentRoot to /var/www/html/zm
- Directory to /var/www/html/zm

Now, when i put 192.168.0.3, I go stright to zm.php. nice
Then I tried what you said, and it worked.

But there the problem is still there : I think that the part of zoneminder that generates the image url in pages directly use the ZM_DIR_EVENTS path instead of generating an adress relative to the website root : the image adress is still http://192.168.0.3/var/www/html/zm/even ... apture.jpg
I think I have to find a way to remove server base path (/var/www/html/zm) from the url generated by scripts.

More information : zm version v1.21.0 compiled on ubuntu, with bt848A chip, apache2, php 4.3.10, mysql 12.22.
The server adress is 192.168.0.3 and I use firefox 1.0.3 on a windows 2000 machine.

how are your paths ?
/etc/apache2/sites-available/default : DocumentRoot and Directory
ZM_DIR_EVENTS
the url of an event image,
the url of zm.php

I think I can make an interesting comparison.
Jolaf
Posts: 14
Joined: Mon May 02, 2005 10:46 pm
Location: Bordeaux (france)

Post by Jolaf »

I started fixing some thing in zm_html_view_frame.php

Code: Select all

//$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorId'].'/'.$event['Id'];
replaced by

Code: Select all

$event_path = '/events/'.$event['MonitorId'].'/'.$event['Id'];
I works, now I have my jpeg frames :)
but they are black :(
Jolaf
Posts: 14
Joined: Mon May 02, 2005 10:46 pm
Location: Bordeaux (france)

Post by Jolaf »

I've made things working, but still don't understand why I have to modify most of the web related path.

I agree with the troubleshooting section of the readme that says path is a little nightmare to handle.

When fixing my trouble I noticed that the problem comes from the fact that ZM_DIR_EVENTS (for instance) is used for both generating path for programs working on the server to access to images, thumbnails, zones ... and for generating urls to access to the files.

so if ZM_DIR_EVENTS=/var/www/html/zm/events/ scripts work fine, but urls ar not.
if ZM_DIR_EVENTS=/events/ scripts does not work but url points to the right place.

I fixed my troubles by writing a phpfunction that removes ZM_PATH_WEB (which is set to /var/www/html/zm/) from web paths. It is used at three (at least) places in php scripts.

I also modified zmvideo.pl (no ffmpeg working) :
chdir( ZM_PATH_WEB.'/'.ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id} );
which I changed to
chdir( ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id} );
(I removed : ZM_PATH_WEB at the begining)

perhaps I misconfigured ZM_PATH_WEB ? what should I have put so as not to have these issues ?
matrix
Posts: 11
Joined: Fri May 06, 2005 6:47 am

Post by matrix »

Jolaf wrote: so if ZM_DIR_EVENTS=/var/www/html/zm/events/ scripts work fine, but urls ar not.
if ZM_DIR_EVENTS=/events/ scripts does not work but url points to the right place.
...
perhaps I misconfigured ZM_PATH_WEB ? what should I have put so as not to have these issues ?
try
ZM_DIR_EVENTS=events
the events directory is relative to the web path

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

Post by cordel »

the path for the events has to be under (in one fashion or another) the web dir.
so if you set the /var/www/html/zm in the http.conf this is now your web root dir.
Now you set the paths in zm relative to that root (/var/www/html/zm) so your events dir would be just /events and not the full path like you have on your hard dirve :)
So if you change the file zm_html_view_frame.php back and set the path in the config menu you should be good to go.
Regards,
Cordel
Locked