Brian Candler
4/11/2007 8:05:00 PM
On Thu, Apr 12, 2007 at 12:43:39AM +0900, Zac Elston wrote:
> /usr/lib/ruby/1.8/net/http.rb:1990:in `read_status_line': wrong status
> line: "[2007-04-11 11:21:03] INFO WEBrick 1.3.1" (Net::HTTPBadResponse)
As you've discovered, you can't run Webrick as an inetd service.
I've never seen anyone run a web service out of inetd. The nearest you get
to this normally is a CGI, where the web server forks a CGI process and
provides it with a CGI environment, which is a modified form of HTTP
environment.
Having said that: there's no theoretical reason why you couldn't do this.
But you'll have to hack out the bits of Webrick which are of interest:
bypass the bit which starts up a listening socket, and pass the incoming
request directly to whichever bit handles one request. If you want to do
this, you're on your own. Good luck.
But do you have any particular reason *not* to use Webrick? If you start a
Ruby interpreter for every incoming request it will be horribly inefficient
anyway. You can always put an Apache proxy in front of it if you're not
happy with the outside world talking directly to Webrick. Or you can run
your application under fastcgi with mod_fcgid.
B.