Capistrano - disable_web and enable_web with lighty?

I was using lighty+fastcgi before, and it was working pretty well, but
I decided to move to Apache+mongrel because I really really like
Mongrel. Well now I found out about lighty+pound+mongrel [1] and I
think I’m going to give that a shot. I definitely prefer lighty to
Apache - it’s pretty ridiculous how much fewer resources it uses.
Anyway the only thing I’m going to miss about Apache is a real
mod_rewrite…and capistrano’s enable/disable_web tasks. Does anyone
know how I can make those work on lighty? I really want them.

Pat

[1]
http://weblog.rubyonrails.com/2006/7/3/pound-makes-lighty-and-mongrel-play-nice

On Jul 3, 2006, at 4:16 PM, Pat M. wrote:

Apache - it’s pretty ridiculous how much fewer resources it uses.
Anyway the only thing I’m going to miss about Apache is a real
mod_rewrite…and capistrano’s enable/disable_web tasks. Does anyone
know how I can make those work on lighty? I really want them.

Hi Pat:

You have a couple of options for supporting disable/enable web.

  1. Have two different lighty configurations and use symlink to the
    appropriate one in disable_web/enable_web. You must reload lighty’s
    configuration after doing so. In your disabled conf, you need
    something like this:

url.rewrite = ( “^/.*” => “/system/maintenance.html” )

  1. Use a CML power magnet (requires mod_cml). And the following to
    your lighty conf:

cml.power-magnet = “/my/path/to/app/config/power-magnet.cml”

Create power-magnet.cml:

dr = request[“DOCUMENT_ROOT”]

if file_isreg(dr … “maintainance.html”) then
output_include = { dr … “maintainance.html” }
return CACHE_HIT
end

Read more at:
http://mongrel.rubyforge.org/docs/lighttpd.html

Good luck,
Bradley Taylor

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs