script not found or unable to stat nph-zms

Support and queries relating to all previous versions of ZoneMinder
Locked
w35m17h
Posts: 2
Joined: Thu Sep 18, 2008 6:21 pm

script not found or unable to stat nph-zms

Post by w35m17h »

Greetings,
I have a Gentoo system using kernel 2.6.24-r5 with just the requirements for zoneminder ver 1.23.3 installed. Mysql, Apache2 etc. I also have a video capture card based on the bttv module loaded and working. Everything seems to work except for streaming video when I click to monitor the camera. When I do this I get the following error in error_log for Apache2

script not found or unable to stat: /var/www/localhost/cgi-bin/nph-zms, referer: http://172.16.1.25/zoneminder/index.php ... 0&control=

Zoneminder does detect motion, record the event and allow me to view them via the "stills" link on the monitor popup page. I've been at this for about a week and I was wondering if someone can point me in the right direction. I hope I have provided enough information to get a discussion going. If not I apologize and will post what is needed for someone to help me. Thank you in advance for your time. One more note, the current livecd works for me so I have used it to model my system after, except in Gentoo distro. Cheers, Bill
w35m17h
Posts: 2
Joined: Thu Sep 18, 2008 6:21 pm

Ok, my questions has already been answered million times...

Post by w35m17h »

Well, I found the answer, on the forum, finally. In plain view, in the FAQ. But in my defense I searched the forums but none of the results seemed to match what I was searching for. When I searched, I didn't pay attention to the 2 radial buttons, the default labeled "Search for any terms or use query as entered" That option just doesn't do my style of search any justice. When I noticed the buttons and changed the search to the button labeled "Search for ALL TERMS" my searches became more relevant and voila, my answer was obvious.

For those coming after me, the answer is to make sure that Apache is looking in the correct place for the Zoneminder cgi's. In Gentoo the default Apache2 configuration is to run virtual hosts. This means the httpd.conf file doesn't hold the ScriptAlias directive. Look in /etc/apache2/vhosts.d/ to find 10_zoneminder.conf. (if you installed zoneminder via emerge) This is where you will find ScriptAlias Directive. Comparing that information to the error msg in the apache error_log shows that apache is looking in the wrong place. So a quick copy of nph-zms from /var/www/zoneminder/cgi-bin to /var/www/localhost/cgi-bin fixed the video streaming problem and verified what needed to be done to correctly fix the problem. Now I just need to adjust the ebuild --with-cgidir option to point to the correct location and re emerge zoneminder. Maybe the ebuild package could be updated to reflect this needed change for Gentoo systems. On another note in the process of getting all this to work on a minimal gentoo install, I have a script that I put together while I built gentoo about 100 times. It is not very good, but it at least will show how I built the current gentoo system to work with zoneminder. If someone is interested they are welcome to look at it. Cheers, Bill.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

What path is defined in your apache config for your cgi directory?
What do you have set in ZM options under the path tab for the zms path?
And where is zms really located?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Glad you got it sorted out.
Cheers
skerit
Posts: 7
Joined: Sat Feb 02, 2008 12:29 am

Post by skerit »

I'm giving it my all getting this to work on Debian, but no luck.

I'm not getting any "no cgi-bin found" errors, or anything looking like it. All I'm getting is the page without the picture.

I've also tried the ubuntu guide on an actual ubuntu install, but it still won't work.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

skerit wrote:I'm giving it my all getting this to work on Debian, but no luck.

I'm not getting any "no cgi-bin found" errors, or anything looking like it. All I'm getting is the page without the picture.

I've also tried the ubuntu guide on an actual ubuntu install, but it still won't work.
Have you tried checking the logs for ZM and Apache?
skerit
Posts: 7
Joined: Sat Feb 02, 2008 12:29 am

Post by skerit »

Apache's logs aren't telling me much.
After some digging I finally found out where to actually put the cgi files (that's one variable you have to set in a lot of places...)

I got this before:

Code: Select all

[Thu Jan 22 23:54:22 2009] [error] [client 192.168.1.3] script not found or unable to stat: /usr/lib/cgi-bin/nph-zms, referer: http://192.168.1.2/zm/in$
[Thu Jan 22 23:54:31 2009] [error] [client 192.168.1.3] script not found or unable to stat: /usr/lib/cgi-bin/nph-zms
[Thu Jan 22 23:55:45 2009] [error] [client 192.168.1.3] Premature end of script headers: zms
But after solving the cgi thing, not anymore.

This is strange, though, in my zmdc.log file:

Code: Select all

23-01-09 00:09:32.965259 zmdc[19027].INF ['zmc -m 1' starting at 09/01/23 00:09:32, pid = 19248]
23-01-09 00:09:32.975155 zmdc[19027].ERR ['zmc -m 1' exited abnormally, exit status 255]
23-01-09 00:09:43.082336 zmdc[19027].INF ['zmc -m 1' starting at 09/01/23 00:09:43, pid = 19262]
23-01-09 00:09:43.092513 zmdc[19027].ERR ['zmc -m 1' exited abnormally, exit status 255]
I'm still getting this in my zmwatch.log, even though I've chmodded 777 al my zm*.sock files:

Code: Select all

23-01-09 00:16:18.814856 zmwatch[19718].ERR [Can't get shared memory id '7a6d0002', 2: Bestand of map bestaat niet]
23-01-09 00:16:18.814949 zmwatch[19718].INF [Restarting capture daemon for test, shared memory not valid]
23-01-09 00:16:18.920211 zmwatch[19718].INF ['zmc -m 2' starting at 09/01/23 00:16:18, pid = 19867]
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

What kind of cameras are these?
If it's a capture board, what does dmesg |grep bttv/saaxxx say?
If it's an IP cam or capture card, with debug set to 5 whats in your debug logs?
Do you see anything in syslog/messages?
skerit
Posts: 7
Joined: Sat Feb 02, 2008 12:29 am

Post by skerit »

It's actually a Hawkinh HNC290G, I'm using a script (created on these forums) to grab the images from it, which works rather well.
So I'm using a file as my source.

Edit: I've found the solution

(From http://sidrit.wordpress.com/2008/08/04/ ... oneminder/ )

Apparently, I didn't have enough shared memory. I didn't know that was possible anymore. This is what fixed it:

(Log in as root. sudo -i, otherwise you won’t be able to)

Code: Select all

echo 134217728 >/proc/sys/kernel/shmall
echo 134217728 >/proc/sys/kernel/shmmax
This solved my shared memory problem. To make these value permanent, edit /etc/sysctl.conf :

Code: Select all

kernel.shmall = 134217728
kernel.shmmax = 134217728
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

The error would have likely been visible if you had turned debug up. Glad you got it sorted.
Locked