Motion - Support Question 2007x 03x 04x 093733

mj-proxy & mj-grab with lighttpd

Question

First of all, I want to say very good job for Motion.

My motion is running in Asus WL-500gd router with Oleg firmware. I use mj-proxy & mj-grab with cambozola to view the image. Everything work fine when using with thttpd web-server.

Now, I want to change the web-server to lighttpd for more security, but I cannot get the mj-proxy & mj-grab work with lighttpd. Other cgi and php work fine with lighttpd, but the nph-mjproxy give error message "java.lang.NullPointerException" and nph-mjgrab only show the frame with no content.

I know this may be lighttpd not properly setup, but after google about this, I still cannot solve this problem. Any help ?

Thanks in advance.

Paste in your error messages, config settings, terminal window output etc in this text field.

Environment

Motion version: 3.2.6
ffmpeg version: 0.4.9-pre1+r6153-1
Libraries: ffmpeg, mysql, postgresql
Server OS: kernel 2.4 in Asus WL-500gd router (Oleg firmware)

-- WilsonWong - 04 Mar 2007

Answer

The special thing about Apache and obviously also thttpd is that CGI scripts that start with nph- are sent though to the browser without the webserver adding or processing any headers. What the CGI script sends the browser sees unmodified.

With non nph CGI scripts - normal CGI scripts - Apache adds a header to the beginning. And this destroys the data so that it does not become a clean jpg or mjpeg.

So you need to find out if lighttpd has this feature. It may not. Or it may have it implemented another way that the primitive naming convention nph-

Now that you know what to ask for some experts on lighttpd will probably be able to give you the answer.

If you find out please come back and give the answer for others to learn from.

-- KennethLavrsen - 04 Mar 2007

I got this to work simply by telling lighttpd to use the binary as a cgi program using the following line in the relevant config file / section:

cgi.assign      = (
        "/nph-mjgrab" => "",
)

This tells lighttpd to use said program direct without any interpreter. Lighttpd's cgi-module contains some logic to deduce whether the cgi is of the non-parsed header variety. This logic is based on the response from the cgi instead of the name of the program. It seems to work for this program...

Environment

Motion version: 3.2.3
Server OS: Ubuntu 7.04 server ( 2.6.20-16) on BP6 with 2x466MHz Celeron...

-- FrankDeLange - 22 Jul 2007

Thanks for your effort, the nph-mjgrab work if I add the
cgi.assign      = (
        "/nph-mjgrab" => "",
)

But it does not work for nph-mjproxy. Of course I had add
cgi.assign      = (
        "/nph-mjproxy" => "",
)

I had also check out the lighttpd forum, they also found that lighttpd has problem with nph type cgi script. Someone had also issue a patch about this problem. Since I do not have an environment to compile the lighttpd, I must wait for the new version.

-- WilsonWong - 23 Jul 2007
Topic revision: r6 - 23 Jul 2007, WilsonWong
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.