[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boa-devel
Subject:    Re: [Boa-devel] internal error when trying to open compiled cgi files in C
From:       Jon Nelson <jnelson () jamponi ! net>
Date:       2002-08-08 14:10:55
[Download RAW message or body]

On Thu, 08 Aug 2002 14:22:14 +0200
"Karl-Henrik Nielsen" <kala3000@hotmail.com> wrote:

> Hello all!
> I have noticed that is not so much happening on this mailiing
> list also another mailing list for people with boa trouble?

There isn't much trouble with Boa ;-)

> Any way, Im Karl-Henrik, and I am doing a diploma by Siemens in
> Greifswald Germany.

Excellent.

> I have however become a problem while using the boa webserver.

That's not good.

> I get an error code 500 from the server when trying to access
> cgi files compiled in C. I have tried the advice on the
> http://www.midwinter.com/~koreth/uncgi.html page regarding the
> problem. But I have not figured it out.
> 
> Is there a special configuration that must be made on the
> webserver? I can run normal cgi scripts, but not compiled cgi
> scripts.

No. If you are able to run "normal" (I assume you mean scripts
that start with "#! /path/to/program"), then running C cgi
scripts should be easier yet.

There is an undocumented configuration item that may help.

Add:

"CgiLog /path/to/logfile" 

to the boa.conf file and restart boa.

Messages that go to stderr for the CGI will go to this file instead
of being thrown away.

> Can it be that the cgi files are compiled wrong.

It's possible.  Can you run the CGI by hand, like this:

./cgi

> What is the error code 500. I have added printf("Content-type:
> text/plain\n\n"); but that does not solve the problem. I am
> using only alphanumeric characters in my form's field names.
> Does error code 500 mean anything else. I am using the
> webserver on an embedded system, and do not have the error list
> installed, so I can not go there and check.

Error 500 means that Boa didn't understand what it got back
from the CGI.  You can try several things, really.

First, try the CgiLog thing above. Also, check the error log
(normally called "error_log") for other indications.

Finally, you can rename the cgi with "nph-" as its first
letters. For example, if the CGI is named "foo", you could
rename it "nph-foo".  If you do this, you will have to generate
a complete HTTP response, like this:

printf("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");

The "HTTP/1.0 200 OK" part is only necessary if you use nph-.
"nph" stands for "No parse headers", which means that boa
will not try to parse the output of the CGI, and just hand
it off to the client (browser).

> Please help me, the only way I can repay the ones that help me
> is to give them a special thanks in the introduction when
> writing my diploma.
> 
> Thanks in advance for all the help I can get!

Sure.  Good luck!


-- 
Jon Nelson
Just because it's not broken doesn't mean we can't take it apart.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Boa-devel mailing list
Boa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/boa-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic