On Fri, Jul 06, 2001 at 12:12:15PM -0400, Bob Drzyzgula wrote:

[..snip..]

> I'm unaware of any way to get classic CGI-style scripting to
> work with just a standalone browser accessing the local filesystem --
> as far as I know there has to be a web server process handling
> the scripting, and this has to be done over a TCP port. Does
> anyone know of another way to do this?

Any CGI binary can be executed from a shell.

Some CGI binaries expect input data in the environment variable
QUERY_STRING, this is where data after the question mark ends up in a GET
request as in http://my.host/cgi-bin/binary?data and <FORM method=get ...>

Some CGI binaries expect input data on standard input, this is how data is
sent to the binary in a POST request, as in <FORM method=post ...>
In this case, the environment variable CONTENT_LENGTH is set to the number
of bytes waiting at stdin.

Some CGI binaries don't need any input data and don't care about
QUERY_STRING, CONTENT_LENGTH and stdin.

All CGI binaries output (at least) a 'Content-type: mime/type\n\n' at the
start of their output.


CGI is a pain, IMHO.  I'm blessed with PHP now.  :)  Unfortunately that's
not true/practical for everyone, I guess.  And especially not as a
requirement for an entire project.


I'd feel good about putting all the CGI crap in a sh/python/whatever layer of
itself, keeping the regular scripts CGI free by default.  The CGI wrapper
would take neccessary means to convert input data to appropriate script
parameters and/or environment variables and add the Content-type header to
the output.  A flag would also be sent to the regular scripts so that they
know to produce HTML output.  An alternative is for the no-longer-so-regular
script to autodetect whether it's being run in a CGI environment or not and
do all these things by itself.

As for configure-via-web-interface I haven't seen any socketless
implementation yet.  I've got two in mind, first SWAT (Samba Web
Administration Tool.  SWAT is a standalone binary bind()ing to port 901 by
default to which you steer your web browser and get a friendly interface to
all that can be done with samba, along with sweet links into the HTML
documentation.  The second is webmin, a set of perl scripts IIRC that you
use for administrating about every part of a UNIX system you can imagine,
add users, remove users, Apache configuration, sendmail configuration etc.
webmin also listens to a port to which you surf and do today's work.  I'm
not a very big fan of webmin, though.  I don't like perl poking around in my
system configuration files.

I don't know if it's overkill but I'd feel good about the project being
standalone.  Even if it takes making a httpd.  Not that I'm familiary with
Python, but I guess it wouldn't be very difficult?


My $0.02.  :)


Oh, and check out http://rom-o-matic.net/ - it's the Etherboot counterpart
of what we're discussing.


//Peter

-- 
Peter Stuge
H�rdvarubolaget
Ideon
S-223 70  Lund
Sweden
GSM. +46-736-601011
Tel. +46-46-2865011
Fax. +46-46-2865199

Reply via email to