Page 1 of 2

where do I change zms path?

Posted: Fri May 20, 2005 4:08 am
by tim@pcs-alaska.com
Hello, I'm trying to get ZM 1.21 to work with my Panasonic KX-HCM10. Looks like it's capturing but I'm getting no streaming or still pictures.

I'm getting this in my /var/log/apache/error.log:

[Thu May 19 19:48:51 2005] [error] [client 127.0.0.1] File does not exist: /var/www/usr/lib/cgi-bin/


Under options I have:
ZM_PATH_ZMS /usr/lib/cgi-bin/


Logs look like this:

/tmp/zmdc.log:
'zmc -m 1' started at 05/05/19 19:31:37
Can't find process with command of 'zmtrack.pl -m 1'
Can't find process with command of 'zma -m 1'

/var/log/syslog:May 19 19:31:37 localhost zmc_m1[1960]: INF [Starting Capture]
May 19 19:37:57 localhost zmc_m1[1960]: INF [Lobby: 1000 - Capturing at 2.63 fps ]
May 19 19:39:01 localhost /USR/SBIN/CRON[2165]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
May 19 19:44:25 localhost zmc_m1[1960]: INF [Lobby: 2000 - Capturing at 2.58 fps ]
May 19 19:50:45 localhost zmc_m1[1960]: INF [Lobby: 3000 - Capturing at 2.63 fps ]
May 19 19:57:00 localhost zmc_m1[1960]: INF [Lobby: 4000 - Capturing at 2.67 fps

/var/log/apache/errors.log:
[Thu May 19 19:48:51 2005] [error] [client 127.0.0.1] File does not exist: /var/www/usr/lib/cgi-bin/


How can I change it so zm looks for the streaming server under just /usr/lib/cgi-bin ?

I'm going to keep trying but not sure how to solve this one....
Did I run config with the wrong path and now I can't change it?

Posted: Fri May 20, 2005 4:15 am
by tim@pcs-alaska.com
This is what my zmconfig.txt reads for the zm_path_zms....but apache is still looking for it under /var/www/usr/lib/cgi-bin/

Name: ZM_PATH_ZMS
Value: /usr/lib/cgi-bin/
Description: Web path to zms streaming server

Posted: Fri May 20, 2005 4:39 am
by tim@pcs-alaska.com
Well, it's recording in RECORD mode. No streaming but I can see stills that look really good. I waved at the camera and clicking through stills it caught just about every move I made. Very cool!

Still can't get anything in MONITOR mode.

Posted: Fri May 20, 2005 5:20 am
by cordel
You will find it in options under the paths tab

Posted: Fri May 20, 2005 5:23 am
by tim@pcs-alaska.com
The location is correct in the options yet the apache error log is saying it's looking in /var/www/usr/lib/cgi-bin/...

Posted: Fri May 20, 2005 5:35 am
by cordel
the path should be just /cgi-bin in your options under the path tab.
All setting for the web for those path are relative to the web root directory.

Posted: Fri May 20, 2005 5:43 am
by voronwe
Heya Tim

Have you cheked your Apache Config File httpd.conf, in that u should find the config line where your cgi-bin path is configured, and check that it is the same as the ZM path to the cgi-bin, next check that the cgi-bin dir is owned by apache and that the user have write / execute rights on it.

The Apache config for the cgi-bin path should look somthing like this :

Code: Select all

ScriptAlias /cgi-bin/ "/var/www/usr/lib/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/usr/lib/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
The httpd.conf can be found in "/etc/httpd/conf/" on FC Systems

If it is still not working after that, well then i will need some info from u. :)

Posted: Fri May 20, 2005 5:46 am
by cordel
The config is not at that location for the RPM version.
it's an custom config called zm.conf located in /etc/httpd/conf.d that is installed as part of the package to insure that the orig http.conf is not changed. and is how we were able to move the static php files and such out of the /var directory. :)

Posted: Fri May 20, 2005 6:02 am
by tim@pcs-alaska.com
I'm running Debian:

/etc/apache/httpd.conf
<IfModule mod_alias.c>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

<Directory /usr/lib/cgi-bin/>
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</IfModule>


So I changed my zm options to just /cgi-bin/
Still can't see a picture but when I right click the picture icon and choose "show picture" I get this which is a new error:

" Forbidden: You don't have permission to access /cgi-bin/ on this server."

zoneminder:/home/tim# ps -aux | grep zm
www-data 1549 0.0 1.0 8040 5620 ? S 21:51 0:00 /usr/bin/perl -wT /u sr/local/bin/zmdc.pl status
www-data 1729 0.0 0.2 2460 1148 ? S 21:55 0:00 sh -c /usr/local/bin /zmpkg.pl restart 2>/dev/null >&- <&- >/dev/null
www-data 1730 2.0 0.8 6596 4176 ? S 21:55 0:00 /usr/bin/perl -wT /u sr/local/bin/zmpkg.pl restart
www-data 1736 3.0 1.0 8040 5508 ? S 21:55 0:00 /usr/bin/perl -wT /u sr/local/bin/zmdc.pl shutdown

zoneminder:/home/tim# ps -aux | grep apache
root 1181 0.0 1.2 13800 6664 ? S 21:46 0:00 /usr/sbin/apache
www-data 1187 0.0 1.5 14796 8244 ? S 21:46 0:00 /usr/sbin/apache
www-data 1188 0.0 1.5 14796 8228 ? S 21:46 0:00 /usr/sbin/apache
www-data 1189 0.1 1.6 14792 8264 ? S 21:46 0:01 /usr/sbin/apache
www-data 1190 0.0 1.5 14716 8136 ? S 21:46 0:00 /usr/sbin/apache
www-data 1191 0.0 1.5 14716 8088 ? S 21:46 0:00 /usr/sbin/apache

So, I changed the owner and group on the /usr/lib/cgi-bin:

zoneminder:/home/tim# ls -l /usr/lib/ | grep cgi-bin
drwxr-xr-x 2 www-data www-data 4096 2005-05-06 16:14 cgi-bin

The contents of my cgi-bin dir:

zoneminder:/home/tim# ls -l /usr/lib/cgi-bin total 4560
-rwxr-xr-x 2 www-data www-data 793972 2005-05-06 01:08 nph-zms
lrwxrwxrwx 1 root root 29 2005-05-06 16:14 php -> /etc/alternatives/php-cgi-bin
-rwxr-xr-x 1 root root 3064088 2005-04-21 00:42 php4
-rwxr-xr-x 2 www-data www-data 793972 2005-05-06 01:08 zms


So then I restarted apache:
zoneminder:/home/tim# apachectl restart
/usr/sbin/apachectl restart: httpd restarted

I still get no picture and again when I click the icon where the picture should be and then click view image I get the:

Forbidden: You don't have permission to access /cgi-bin/ on this server.

Should I change something in httpd.conf to allow access to the cgi-bin?

Thanks for troubleshooting this with me!

Posted: Fri May 20, 2005 6:04 am
by voronwe
Hmmmm even stranger since the apache error he posted is telling me that apache is looking for the cgi-bin dir in :

Code: Select all

/var/www/usr/lib/cgi-bin/
That is the basis for my config example.

Posted: Fri May 20, 2005 6:07 am
by cordel
The rpm version has the zms scripts at /usr/lib/zm/cgi-bin
I'm not sure what changed to get the path that he has.
Take that back...
Going through all his posts I find that this is not my RPM and is a Debian install.
I had missed that.

Posted: Fri May 20, 2005 6:08 am
by voronwe
Could you please post the ls command for the "/usr/lib/ " so i can see what the permissions are on the cgi-bin dir. :)

Posted: Fri May 20, 2005 6:16 am
by voronwe
Hehe np Cordel, i just saw that as well hehe.

But still Tim, your apache server is complaining avout some config error, that has somthing to do with your cgi-bin dir, is there any other errors in the log, and what does it say in access log, u could try and stop zm and apache, and then delete the log files to get a clean 1 to cacth all the errors that both deamons report, and nm my last post saw that your cgi-bin dir have rwxr-xr-x witch should be enough.

Posted: Fri May 20, 2005 6:17 am
by tim@pcs-alaska.com
Sure,

tim@zoneminder:~$ ls -l /usr/lib | grep cgi-bin
drwxr-xr-x 2 www-data www-data 4096 2005-05-06 16:14 cgi-bin

Note, my errors changed about the /var/www/usr/lib/cgi-bin when I changed my options in ZM to just /cgi-bin/ as this is the alias for /usr/lib/cgi-bin.

Posted: Fri May 20, 2005 6:21 am
by cordel
The scripts must be under the web root in one fashon or another. That is why it is in your log /var/www since this is your root for your web and it assumes that /usr/lib/cgi-bin is under the root for the web. So if your alias for cgi-bin is /usr/lib/cgi-bin just setting /cgi-bin should work as long as permisions allow. You might want to drop IfOwnersMatch.