9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] rc-httpd "write error" when using cgi
@ 2023-02-24 10:14 Ralf Wissing
  2023-02-24 12:01 ` Alex Musolino
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Wissing @ 2023-02-24 10:14 UTC (permalink / raw)
  To: 9front

Hi everyone,

i am currently experimenting with rc-httpd, and while it works flawless serving static sites i cannot get even a simple cgi script working. 

Here something i tried:

I have a simple rc script which echos a "hello world" html page (which i cannot include in this mail without getting rejected for using html mail). 

Then there is the following configuration:

File /rc/bin/rc-httpd/select-handler
%<------------------------
#!/bin/rc

PATH_INFO=$location
FS_ROOT=/usr/web

exec static-or-cgi /usr/web/cgitest.rc

%<------------------------


Running it with aux/listen1 i get only the following after visiting the page with a browser:

%<------------------------
echo: write error: Hangup
%<------------------------

I am sure that i miss something obvious... and i would now after a few hours tinkering appreciate any kick in the right direction.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] rc-httpd "write error" when using cgi
  2023-02-24 10:14 [9front] rc-httpd "write error" when using cgi Ralf Wissing
@ 2023-02-24 12:01 ` Alex Musolino
  2023-02-25 11:11   ` Ralf Wissing
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Musolino @ 2023-02-24 12:01 UTC (permalink / raw)
  To: 9front

> Then there is the following configuration:
> 
> File /rc/bin/rc-httpd/select-handler
> %<------------------------
> #!/bin/rc
> 
> PATH_INFO=$location
> FS_ROOT=/usr/web
> 
> exec static-or-cgi /usr/web/cgitest.rc

This part works fine for me.

> Running it with aux/listen1 i get only the following after visiting
> the page with a browser:

What is "it" that you are running with aux/listen1?  You should be
running /rc/bin/rc-httpd/rc-httpd not /rc/bin/rc-httpd/select-handler.

--
Cheers,
Alex Musolino


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] rc-httpd "write error" when using cgi
  2023-02-24 12:01 ` Alex Musolino
@ 2023-02-25 11:11   ` Ralf Wissing
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Wissing @ 2023-02-25 11:11 UTC (permalink / raw)
  To: 9front

A glass of whiskey, a nights sleep was enough to let me see where i seemingly made an error:

Added "echo 'HTTP/1.1 200'" to the cgi script, now everything is working.


Quoth Alex Musolino <alex@musolino.id.au>:
> > Then there is the following configuration:
> > 
> > File /rc/bin/rc-httpd/select-handler
> > %<------------------------
> > #!/bin/rc
> > 
> > PATH_INFO=$location
> > FS_ROOT=/usr/web
> > 
> > exec static-or-cgi /usr/web/cgitest.rc
> 
> This part works fine for me.
> 
> > Running it with aux/listen1 i get only the following after visiting
> > the page with a browser:
> 
> What is "it" that you are running with aux/listen1?  You should be
> running /rc/bin/rc-httpd/rc-httpd not /rc/bin/rc-httpd/select-handler.
> 
> --
> Cheers,
> Alex Musolino
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-25 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 10:14 [9front] rc-httpd "write error" when using cgi Ralf Wissing
2023-02-24 12:01 ` Alex Musolino
2023-02-25 11:11   ` Ralf Wissing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).