views:

454

answers:

1

I've received some really great guidance from users of this site, and I'm thinking some advanced Rails people could assist me in resolving the following problem.

I'm attempting to deploy a simple Rails application on a win32 server.

I've been carefully working through these instructions (see http://functionalelegant.blogspot.com/2008/05/deploying-rails-on-windows.html) for win32 Rails application deployment.

I started from a more-or-less clean windows install, then downloaded and installed

  1. Ruby
  2. LightTPD
  3. Rails
  4. Zed's SCGI Rails Runner
  5. Windows Server 2003 Resource Kit Tools
  6. Ruby/DBI ADO package

After that, I've done the following:

I've commented out the line in the SCGI gem (which actually was causing trouble.)

I created the directory structure as suggested, with folders for logs.

I modified the scgi.yaml file and the Lighty config files to reflect my environmental settings.

After this, I wrote the batch scripts to start up Lighty and the SGCI process. They appear to run correctly. However, inside app-errors.log the following lines appear:

2009-05-15 16:48:06: (mod_scgi.c.2645) fcgi: got a FDEVENT_ERR. Don't know why. 
2009-05-15 16:48:06: (mod_scgi.c.2469) emergency exit: scgi: connection-fd: 7 fcgi-fd: 8


Finally, when I navigate to http://localhost:xxxx/ I just see a blank page. Update: I just realized the blank page only appeared to be. Viewing the source revealed the following issue:

2C:/Ruby/lib/ruby/1.8/drb/drb.rb:573:in `load'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:612:in `recv_request'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:911:in `recv_request'"?C:/Ruby/lib/ruby/1.8/drb/drb.rb:1530:in `init_with_client'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1542:in `setup_message'"6C:/Ruby/lib/ruby/1.8/drb/drb.rb:1494:in `perform'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1589:in `main_loop'"3C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `loop'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `main_loop'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `start'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `main_loop'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1430:in `run'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `start'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `run'"9C:/Ruby/lib/ruby/1.8/drb/drb.rb:1347:in `initialize'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `new'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `start_service'"MC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/lib/scgi.rb:402:in `run'"HC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/bin/scgi_service:61"*C:/Ruby/bin/scgi_service:19:in `load'" C:/Ruby/bin/scgi_service:19:   mesg" too large packet

Note that 'ruby script/server' runs just fine, but the page then can't be seen externally.

Any ideas? Please let me know if anything jumps out at you.

+3  A: 

I wrote the chapter for this in 'Deploying Rails Applications'. http://www.pragprog.com/titles/fr_deploy/deploying-rails-applications

Basically, you want mongrel, mongrel_service, and apache 2.2 with mod_proxy_balancer for windows.

You install 2 or more instances of your app with Mongrel running on separate ports. You set the services to autostart.

Then you set up apache to balance to them.

This is all outlined in the book, and I have some older articles on my website too - if you search for "deloying rails on windows" you'll find some pretty out of date stuff. The apache+mongrel way is the best way for Windows right now, and if you need additional help, feel free to let me know. I'd be glad to help.

Brian Hogan
Brian,Thanks for your quick and informative response! I've just picked up and have been trying to work through the Windows chapter in the 'Deploying Rails Apps' book.* I already had several instances of Mongrel up and running the app over a modest range of ports.* I got hung up at the bit about Pen, because first it needed the Cygwin DLL, and then once I gave it the library, it said the number of simultaneous processes was too large. * I have been attempting to work through your tips for Apache. httpd runs without errors, but the Rails app isn't available, just a blank page...Joe
Joe
The message about processes can be ignored. But don't use Pen... just use apache + mod_proxy_balance, use a vhost, and it should just work. That book should have the vhost configuration in it, but you can use this as an example - http://svn.napcsweb.com/public/guestbook/config/apache/guestbook_proxy.confJust change the paths, include this in your main apache config and let's see what happens.
Brian Hogan