Win32 上的 Rails 部署最佳实践:Lighty + SGCI

发布于 2024-07-20 15:50:03 字数 2394 浏览 2 评论 0原文

我从这个网站的用户那里收到了一些非常好的指导,我想一些高级 Rails 人员可以帮助我解决以下问题。

我正在尝试在 win32 服务器上部署一个简单的 Rails 应用程序。

我一直在仔细研究这些说明(请参阅 http:// /functionalelegant.blogspot.com/2008/05/deploying-rails-on-windows.html)用于 win32 Rails 应用程序部署。

我从或多或少干净的 Windows 安装开始,然后下载并安装了

  1. Ruby
  2. LightTPD
  3. Rails
  4. Zed 的 SCGI Rails Runner
  5. Windows Server 2003 资源工具包工具
  6. Ruby/DBI ADO 包

之后,我完成了以下操作:

我已注释掉SCGI gem 中的行(实际上造成了麻烦。)

我按照建议创建了目录结构,其中包含日志文件夹。

我修改了 scgi.yaml 文件和 Lighty 配置文件以反映我的环境设置。

之后,我编写了批处理脚本来启动 Lighty 和 SGCI 进程。 它们似乎运行正确。 但是,在 app-errors.log 内出现以下几行:

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 

最后,当我导航到 http://localhost:xxxx/ 我只看到一个空白页。 更新:我刚刚意识到空白页只是看起来而已。 查看源代码发现了以下问题:

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

请注意,“ruby script/server”运行良好,但外部无法看到该页面。

有任何想法吗? 如果您有任何问题,请告诉我。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空袭的梦i 2024-07-27 15:50:03

我在“部署 Rails 应用程序”中为此编写了章节。 http://www.pragprog.com/titles/fr_deploy/deploying-rails-基本上

,您需要 mongrel、mongrel_service 和带有 mod_proxy_balancer for windows 的 apache 2.2。

您安装了 2 个或更多应用程序实例,并在不同的端口上运行 Mongrel。 您将服务设置为自动启动。

然后你设置 apache 来平衡它们。

这一切都在书中概述,我的网站上也有一些较旧的文章 - 如果您搜索“在 Windows 上部署导轨”,您会发现一些相当过时的东西。 apache+mongrel 方式是目前 Windows 上最好的方式,如果您需要其他帮助,请随时告诉我。 我很乐意提供帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文