POV-Ray : Newsgroups : povray.off-topic : Simply CGI Server Time
14 Oct 2026 12:15:51 EDT (-0400)
  Simply CGI (Message 1 to 25 of 25)  
From: Invisible
Subject: Simply CGI
Date: 12 Sep 2008 06:10:30
Message: <48ca4016@news.povray.org>
I want to write a large, complex CGI program.

However, I do *not* feel like installing and configuring Apache just so 
I can run my CGI program.

Does *anybody* know of a nice, simple little program that will accept 
HTTP requests and pass them to my CGI program? All I really want is a 
tiny little program to parse the HTTP headers, feed them into my CGI 
program, and pass back the answers to the web browser. But I can't seem 
to find anything that will do that... All I can find is full-featured 
web servers that you have to install and configure. I just want a 
single-file executable... Anybody know of one?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: Simply CGI
Date: 12 Sep 2008 09:13:38
Message: <48ca6b02@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Does *anybody* know of a nice, simple little program that will accept 
> HTTP requests and pass them to my CGI program?

  Any unix command-line shell will do. HTTP is pure ascii.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Simply CGI
Date: 12 Sep 2008 09:25:21
Message: <48ca6dc1$1@news.povray.org>
Warp wrote:
> Invisible <voi### [at] devnull> wrote:
>> Does *anybody* know of a nice, simple little program that will accept 
>> HTTP requests and pass them to my CGI program?
> 
>   Any unix command-line shell will do. HTTP is pure ascii.

Yes, but parsing a HTTP request, putting the various parts of the 
request into the necessary environment variables and piping to stdin 
while running the CGI binary, parsing its output and adding HTTP headers 
to send back to the web browser is... quite a lot of work. And a billion 
opportunities for mistakes. Surely I can't be the first person on Earth 
to have wanted to quickly test a CGI script without having to install a 
web server?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: John VanSickle
Subject: Re: Simply CGI
Date: 12 Sep 2008 11:53:26
Message: <48ca9076@news.povray.org>
Invisible wrote:
> I want to write a large, complex CGI program.
> 
> However, I do *not* feel like installing and configuring Apache just so 
> I can run my CGI program.
> 
> Does *anybody* know of a nice, simple little program that will accept 
> HTTP requests and pass them to my CGI program? All I really want is a 
> tiny little program to parse the HTTP headers, feed them into my CGI 
> program, and pass back the answers to the web browser. But I can't seem 
> to find anything that will do that... All I can find is full-featured 
> web servers that you have to install and configure. I just want a 
> single-file executable... Anybody know of one?

Maybe this one will work:

http://shttpd.sourceforge.net/

My Linux programming book has a simple server described in one of it's 
chapters, but it's too long to type out here.

Regards,
John


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: Simply CGI
Date: 12 Sep 2008 12:22:36
Message: <48ca974c$1@news.povray.org>
Invisible a écrit :
> Warp wrote:
>> Invisible <voi### [at] devnull> wrote:
>>> Does *anybody* know of a nice, simple little program that will accept 
>>> HTTP requests and pass them to my CGI program?
>>
>>   Any unix command-line shell will do. HTTP is pure ascii.
> 
> Yes, but parsing a HTTP request, putting the various parts of the 
> request into the necessary environment variables and piping to stdin 
> while running the CGI binary, parsing its output and adding HTTP headers 
> to send back to the web browser is... quite a lot of work. And a billion 
> opportunities for mistakes. Surely I can't be the first person on Earth 
> to have wanted to quickly test a CGI script without having to install a 
> web server?
> 
But what you describe looks awfully like a web server to me... Surely 
there are some on this page that have a very minimal configuration:

http://en.wikipedia.org/wiki/Tiny_web_servers

I tried hiawatha and nullhttpd here and it seems to work. Didn't try CGI 
though, and I'm on linux... Nullhttpd does not seem to be very nicely 
documented though.

-- 
Vincent


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 12 Sep 2008 13:19:09
Message: <48caa48d$1@news.povray.org>
Vincent Le Chevalier wrote:

> But what you describe looks awfully like a web server to me...

Yeah - except that I don't *need* HTTPS, virtual hosting, customisable 
HTTP error pages, multi-level access control with permission seperation, 
complex logging facilities, the ability to run as a background service, 
or any of the myriad of other stuff that a "real" HTTP server needs to 
have. I just need something to run CGI binaries.

> Surely 
> there are some on this page that have a very minimal configuration:
> 
> http://en.wikipedia.org/wiki/Tiny_web_servers

I had a look here this morning. Sadly, almost everything requires you to 
"install" it before you can use it. I was hoping for a single executable 
solution.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 12 Sep 2008 13:22:48
Message: <48caa568$1@news.povray.org>
John VanSickle wrote:

> Maybe this one will work:
> 
> http://shttpd.sourceforge.net/

Looks promising...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 12 Sep 2008 13:41:14
Message: <48caa9ba$1@news.povray.org>
>> Maybe this one will work:
>>
>> http://shttpd.sourceforge.net/
> 
> Looks promising...

Hmm. Seems to work perfectly, except for two things:

1. For some reason, it takes about 45 seconds to start up. No CPU usage, 
no network activity, it just seems to hang for 45 seconds. And then it 
works normally.

2. It seems to be able to run CGI *scripts*, but not compiled, 
executable binary programs. I'm still frobbing the configuration file, 
but it's not looking good...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 12 Sep 2008 13:53:35
Message: <48caac9f@news.povray.org>
Orchid XP v8 wrote:

> 2. It seems to be able to run CGI *scripts*, but not compiled, 
> executable binary programs. I'm still frobbing the configuration file, 
> but it's not looking good...

OK, *finally*...

Create a small file called Foo.cgi that simply contains the line

   #!Foo.exe

and *at last* the server does what I want it to!

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: Simply CGI
Date: 12 Sep 2008 17:06:56
Message: <48cad9ef@news.povray.org>
Vincent Le Chevalier <gal### [at] libertyallsurfspamfr> wrote:
> But what you describe looks awfully like a web server to me...

  Yeah. He wants a web server without installing a web server.

-- 
                                                          - Warp


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Simply CGI
Date: 12 Sep 2008 17:49:05
Message: <48cae3d1@news.povray.org>
Invisible wrote:

> I want to write a large, complex CGI program.
> 
> However, I do *not* feel like installing and configuring Apache just so
> I can run my CGI program.
> 
> Does *anybody* know of a nice, simple little program that will accept
> HTTP requests and pass them to my CGI program? All I really want is a
> tiny little program to parse the HTTP headers, feed them into my CGI
> program, and pass back the answers to the web browser. But I can't seem
> to find anything that will do that... All I can find is full-featured
> web servers that you have to install and configure. I just want a
> single-file executable... Anybody know of one?

In KDE, in any kioslaves-enabled application (like the Konqueror browser),
you can use cgi:/home/invisible/mycgiapp as a URL and it will just work :)


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 13 Sep 2008 05:27:15
Message: <48cb8773$1@news.povray.org>
Warp wrote:

>   Yeah. He wants a web server without installing a web server.

And I got one. Yay for me! :-)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: Simply CGI
Date: 13 Sep 2008 06:38:45
Message: <48cb9835$1@news.povray.org>
Orchid XP v8 a écrit :
> Orchid XP v8 wrote:
> 
>> 2. It seems to be able to run CGI *scripts*, but not compiled, 
>> executable binary programs. I'm still frobbing the configuration file, 
>> but it's not looking good...
> 
> OK, *finally*...
> 
> Create a small file called Foo.cgi that simply contains the line
> 
>   #!Foo.exe
> 
> and *at last* the server does what I want it to!
> 
Apparently this server only checks the extensions of the files, so you 
could just rename Foo.exe to Foo.cgi I suppose. Or better still, launch 
shttpd with the appropriate option telling it that .exe are CGI files:

shttpd -cgi_ext "exe"

Seems to work on my linux box with any arbitrary extension...

-- 
Vincent


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 13 Sep 2008 07:06:57
Message: <48cb9ed1@news.povray.org>
>> OK, *finally*...
>>
>> Create a small file called Foo.cgi that simply contains the line
>>
>>   #!Foo.exe
>>
>> and *at last* the server does what I want it to!
>>
> Apparently this server only checks the extensions of the files, so you 
> could just rename Foo.exe to Foo.cgi I suppose.

I tried that, but it doesn't work. If it's .cgi, it "checks the first 
line of text to determine what interpretter to run".

> Or better still, launch 
> shttpd with the appropriate option telling it that .exe are CGI files:
> 
> shttpd -cgi_ext "exe"

Also tried that and it didn't work.

The hack above does, however, work.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: Simply CGI
Date: 13 Sep 2008 07:45:32
Message: <48cba7dc@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Warp wrote:

> >   Yeah. He wants a web server without installing a web server.

> And I got one. Yay for me! :-)

  You got a web server and you didn't install it? How can that work?

-- 
                                                          - Warp


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: Simply CGI
Date: 13 Sep 2008 08:57:03
Message: <48cbb89f@news.povray.org>
Orchid XP v8 a écrit :
>> Or better still, launch shttpd with the appropriate option telling it 
>> that .exe are CGI files:
>>
>> shttpd -cgi_ext "exe"
> 
> Also tried that and it didn't work.
> 
> The hack above does, however, work.
> 

OK, so that's one more reason for me to keep running Linux I guess, 
where it works fine and starts instantaneously :-)

Maybe you should throw a note to the author though, perhaps the 
behaviour on Windows is not what's intended...

-- 
Vincent


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 13 Sep 2008 08:58:17
Message: <48cbb8e9$1@news.povray.org>
Warp wrote:

>   You got a web server and you didn't install it? How can that work?

You put the executable file in a directory, double-click it, and it 
runs. Nothing to install, nothing to uninstall afterwards. And only a 
few hundred KB too. Which is basically what I was looking for...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Doctor John
Subject: Re: Simply CGI
Date: 13 Sep 2008 09:01:21
Message: <48cbb9a1$1@news.povray.org>
Orchid XP v8 wrote:
> Warp wrote:
> 
>>   You got a web server and you didn't install it? How can that work?
> 
> You put the executable file in a directory, double-click it, and it 
> runs. Nothing to install, nothing to uninstall afterwards. And only a 
> few hundred KB too. Which is basically what I was looking for...
> 
So you've installed it. OTOH you haven't needed to configure it or your 
system.

John

-- 
"Eppur si muove" - Galileo Galilei


Post a reply to this message

From: Warp
Subject: Re: Simply CGI
Date: 13 Sep 2008 09:57:47
Message: <48cbc6db@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Warp wrote:

> >   You got a web server and you didn't install it? How can that work?

> You put the executable file in a directory, double-click it, and it 
> runs. Nothing to install, nothing to uninstall afterwards. And only a 
> few hundred KB too. Which is basically what I was looking for...

  We clearly have completely different definitions of "installing a
program".

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v8
Subject: Re: Simply CGI
Date: 13 Sep 2008 10:14:47
Message: <48cbcad7$1@news.povray.org>
Warp wrote:

>   We clearly have completely different definitions of "installing a
> program".

Yes.

To me, if you can use a program just by running it, that's not 
"installing" it.

If, however, you have to insert DLLs into particular folders, create 
registry keys and configure environment variables, that's "installing" 
something.

The former means you can just drop the binary only (say) a USB flash 
drive and use it anywhere. The latter means that you have to do some 
setup (and probably removal) at every PC.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: Simply CGI
Date: 13 Sep 2008 11:00:21
Message: <48cbd584@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Warp wrote:

> >   We clearly have completely different definitions of "installing a
> > program".

> Yes.

  My definition of "installing" is clear and unambiguous. Your definition
is rather fuzzy.

> To me, if you can use a program just by running it, that's not 
> "installing" it.

> If, however, you have to insert DLLs into particular folders, create 
> registry keys and configure environment variables, that's "installing" 
> something.

  What if it doesn't install DLLs but creates registy keys and configures
environment variables? Is it then installing? What if it doesn't configure
environment variables? Is it still installing? What if it installs DLLs
but doesn't create a registry key?

> The former means you can just drop the binary only (say) a USB flash 
> drive and use it anywhere. The latter means that you have to do some 
> setup (and probably removal) at every PC.

  But you didn't "drop the binary only a USB flash drive" (whatever that
may mean). You installed it in your system.

-- 
                                                          - Warp


Post a reply to this message

From: Chris Cason
Subject: Re: Simply CGI
Date: 15 Sep 2008 07:07:16
Message: <48ce41e4@news.povray.org>
I've used thttpd in a number of embedded systems. Seems to do the job well
and is a single executable.

-- Chris


Post a reply to this message

From: Darren New
Subject: Re: Simply CGI
Date: 19 Sep 2008 15:14:38
Message: <48d3fa1e$1@news.povray.org>
Orchid XP v8 wrote:
> I had a look here this morning. Sadly, almost everything requires you to 
> "install" it before you can use it. I was hoping for a single executable 
> solution.

http://www.tcl.tk/software/tclhttpd/

The TclHttpd Starkit distribution includes the server code, the required 
TclLib modules, and a sample document tree in a single file for easy 
deployment. Just run the starkit with the TclKit interpreter. It takes 
all the same command line arguments as bin/httpd.tcl. Using the sdx tool 
that wraps and unwraps Starkits, you can assemble your own custom 
TclHttpd application Starkit.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Invisible
Subject: Re: Simply CGI
Date: 25 Sep 2008 05:45:34
Message: <48db5dbe$1@news.povray.org>
Orchid XP v8 wrote:

> OK, *finally*...
> 
> Create a small file called Foo.cgi that simply contains the line
> 
>   #!Foo.exe
> 
> and *at last* the server does what I want it to!

Now I'm confused! I just tried this at work... and it fails. WTF?


Post a reply to this message

From: Invisible
Subject: Re: Simply CGI
Date: 25 Sep 2008 05:57:07
Message: <48db6073@news.povray.org>
Chris Cason wrote:
> I've used thttpd in a number of embedded systems. Seems to do the job well
> and is a single executable.

Unfortunately, I can't find a precompiled Windows binary anywhere...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.