Camping + Apache2 + FastCGI + Windows

3 views
Skip to first unread message

Eli

unread,
Apr 9, 2007, 5:18:54 PM4/9/07
to Israel.rb
Imagine that -- a real technical problem on the forum!!!

Everything seems to be all set up and wired nicely -- so why doesn't
it just ... work?

Does anyone have experience with Camping on this platform?

Thanks a million.

-Eli

SonOfLilit

unread,
Apr 10, 2007, 1:12:40 AM4/10/07
to isra...@googlegroups.com
Did you first try using Camping's default deploy and see that it works?

Aur

Eli

unread,
Apr 10, 2007, 2:41:53 AM4/10/07
to Israel.rb
It runs fine on the included WEBrick server, if that's what you meant.
I was happily coding away, and I decided it was time to run it on
apache so it could be available on port 80 along with my other
webprojects. Then I burned half a day trying to figure out how to get
it to run.

Thanks for your help!!
-Eli

On Apr 10, 8:12 am, SonOfLilit <sonofli...@gmail.com> wrote:
> Did you first try using Camping's default deploy and see that it works?
>
> Aur
>

SonOfLilit

unread,
Apr 10, 2007, 2:57:23 AM4/10/07
to isra...@googlegroups.com
I guess you've read all the camping site? If so, I can't help anymore, sorry.


Aur

On 4/10/07, Eli <ewo...@gmail.com> wrote:
>

Eli

unread,
Apr 11, 2007, 5:52:55 AM4/11/07
to Israel.rb
Ok, in case anyone cares, I found my problem.

I discovered that ruby scripts under FastCGI are kind of
temperamental. You have to wear kid gloves.

Certain errors during Ruby execution would be caught by the script's
error handling, other errors bypassed them entirely and simply crashed
the FastCGI module. The server would report a 500 error, with
absolutely no reason and nothing worth looking at in the logs.

One such way to get a 500 error is to have a ruby script fail during a
"require". I had a bunch of those that worked under IRB but did not
work under FastCGI ... for instance, "require 'camping'" didn't work,
because camping was a gem and I hadn't called "require 'rubygems'"
yet.

It took much playing around to find it, because, as I said, there was
no log with a readable exception.

Getting it to work heartened me greatly, and now I feel like I can
take on the world.

SonOfLilit

unread,
Apr 11, 2007, 5:59:35 AM4/11/07
to isra...@googlegroups.com
Glad you succeeded.

On 4/11/07, Eli <ewo...@gmail.com> wrote:
>
> Ok, in case anyone cares, I found my problem.
>
> I discovered that ruby scripts under FastCGI are kind of
> temperamental. You have to wear kid gloves.
>
> Certain errors during Ruby execution would be caught by the script's
> error handling, other errors bypassed them entirely and simply crashed
> the FastCGI module. The server would report a 500 error, with
> absolutely no reason and nothing worth looking at in the logs.
>
> One such way to get a 500 error is to have a ruby script fail during a
> "require". I had a bunch of those that worked under IRB but did not
> work under FastCGI ... for instance, "require 'camping'" didn't work,
> because camping was a gem and I hadn't called "require 'rubygems'"
> yet.
>
> It took much playing around to find it, because, as I said, there was
> no log with a readable exception.
>
> Getting it to work heartened me greatly, and now I feel like I can
> take on the world.
>

_why does that :P

> On Apr 10, 12:18 am, "Eli" <ewok...@gmail.com> wrote:
> > Imagine that -- a real technical problem on the forum!!!
> >
> > Everything seems to be all set up and wired nicely -- so why doesn't
> > it just ... work?
> >
> > Does anyone have experience with Camping on this platform?
> >
> > Thanks a million.
> >
> > -Eli
>
>
> >
>

Aur

vitaly

unread,
Apr 12, 2007, 2:55:24 PM4/12/07
to Israel.rb
Did you consider running it on mongrel with apache as a proxy?
This seems to be the recommended setup lately. all this FastCGI thing
while giving
a few points of performance is far from stable.

Eli

unread,
Apr 12, 2007, 3:49:14 PM4/12/07
to Israel.rb
I didn't know there was such a configuration!!!
Maybe next time. I got it working, so ..... why bother.
Besides, I'd have one more service to have running in Windows -- I
like it when everything is consolidated in Apache.

Thanks so much for the idea, I'll check it out if FastCGI gives me
unforgivable problems in the future.

-Eli

Adam Fine

unread,
Apr 12, 2007, 4:48:13 PM4/12/07
to isra...@googlegroups.com
Yes, Mongrel supports Camping:

http://mongrel.rubyforge.org/rdoc/classes/Mongrel/Camping.html

And I second vitaly here: Mongrel is more stable than FastCGI, and in
general, a better choice.

Eli

unread,
Apr 17, 2007, 5:52:36 PM4/17/07
to Israel.rb
Thanks to all for the great tips.
I am running Mongrel now, with the proxy to Apache. It's sweet! *MUCH*
more stable than FastCGI.

However - I need it to be a Windows service. I tried using the win32-
service gem, but Mongrel acts funny when it's running as a service.
Something is listening on the port, but an http request returns blank.

I'm running it using the standard:

Camping::Models::Base.establish_connection :adapter => 'sqlite3',
:database => 'tmp/camping.db'
h = Mongrel::HttpServer.new("0.0.0.0", 3001)
h.register("/catcarrier",
Mongrel::Camping::CampingHandler.new(CampingModule))
h.register("/favicon.ico", Mongrel::Error404Handler.new(""))
h.run.join

This works when I run the script in interactive mode. But under the
service (and wrapped in the "Daemon" class) I get the blank response.
(Note I can't use the mongrel-service because that's custom built for
Rails apps.)

Again ... does anyone have any experience with this?
Thanks.
-Eli

Reply all
Reply to author
Forward
0 new messages