I have to work in a traditional (i.e., fork/exec) CGI environment. I
would like to use WEBRick because it supports servlets (which is
something I understand).
Is there a way to use the WEBRick servlet stuff inside a CGI
environment? This seems like a reasonable thing to do, but everything
I read on WEBRick starts with the WEBRick HTTP server. I would like to
use it from the servlet environment down. I'd also like to be able to
move back and forth between CGI and FastCGI, if possible.
Also, I would like to know where to look for any sort of web framework
that works inside traditional CGI (it would be cool, of course, if it
also worked in FastCGI with no changes). Is WEBRick the best choice?
What does Rails use (I understand it runs under FastCGI)?
Thanks for any help or guidance.
--Kevin
objectuser wrote:
Also, I would like to know where to look for any sort of web framework
that works inside traditional CGI (it would be cool, of course, if it
also worked in FastCGI with no changes).
Nitro works under CGI, FastCGI, WEBrick, and ligHTTP. Migration from one to another is fairly painless.
You will probably want to get away from CGI if your application makes use of much dynamic code invocation, O/R mapping, templating, and such (pretty much true regardless of app framework), though Nitro makes it very easy to start simple and evolve your application as requirements dictate, only using the parts you actually need.
http://nitro.rubyforge.org/
http://www.navel.gr/nitro/
James
It sounds like WEBrick is too low-level for what you want -- though
writing a CGI proxy to connect to a webrick server is possible.
Something more abstract like Nitro, IOWA or Rails might fit the bill better.
···
On 4/19/05, objectuser <objectuser@gmail.com> wrote:
I have to work in a traditional (i.e., fork/exec) CGI environment. I
would like to use WEBRick because it supports servlets (which is
something I understand).
Is there a way to use the WEBRick servlet stuff inside a CGI
environment? This seems like a reasonable thing to do, but everything
I read on WEBRick starts with the WEBRick HTTP server. I would like to
use it from the servlet environment down. I'd also like to be able to
move back and forth between CGI and FastCGI, if possible.
Yeah, traditional CGI sucks, but I'm stuck with it for the time being.
I do have to connect to a database, which will make it suck more (is
there even a way to do connection pooling?).
I'll check out Nitro. So, basically, WEBrick is not really what I'm
looking for--it really can't be used without the HTTP server portion?
I'm getting this from your post, as well as that of Aredridel's (thanks
to you both).
--Kevin
You might want to check out sqlrelay (http://sqlrelay.sourceforge.net/\) for connection pooling. There are several language bindings (including one for Ruby).
objectuser wrote:
···
Yeah, traditional CGI sucks, but I'm stuck with it for the time being.
I do have to connect to a database, which will make it suck more (is
there even a way to do connection pooling?).
I'll check out Nitro. So, basically, WEBrick is not really what I'm
looking for--it really can't be used without the HTTP server portion?
I'm getting this from your post, as well as that of Aredridel's (thanks
to you both).
--Kevin
That looks cool, too, but I can't even run a server. These are all
restrictions of our hosting provider. I can use traditional CGI and
.... that's about it. If it's too slow, we might have to switch
providers, but we like everything else about them ...
Thanks, again!
--Kevin
Ah, fun.
Yeah. Webrick -is- the HTTP server, so that's a no-go. CGI as the
interface is what you're stuck with, but there's a ton of usable
abstractions on top of that . It's quite a restriction, but won't
prevent all utility.
···
On 4/20/05, objectuser <objectuser@gmail.com> wrote:
That looks cool, too, but I can't even run a server. These are all
restrictions of our hosting provider. I can use traditional CGI and
.... that's about it. If it's too slow, we might have to switch
providers, but we like everything else about them ...