# Capistrano deploy:web:disable doesn't work

**URL:** <https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976>\
**Category:** Rails\
**Created:** [August 18, 2009, 10:04pm UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976 "2009-08-18T22:04:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [August 18, 2009, 10:04pm UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976/1 "2009-08-18T22:04:15Z")

</div>

Hi all,

I’m trying to figure out why cap deploy:web:disable isn’t working for my  
server. I’m adding a pastie with the example apache RewriteCond I’m  
using with my rails app.

[http://pastie.org/587619](http://pastie.org/587619)

The document root is correct, I’ve just changed the username and the  
name of the site domain. Pretend that the username and the site domain  
are valid when looking at the pastie.

Is there something I’m doing wrong here?

The DocumentRoot is on line #5.

The Rewritecond are on lines 38,39,40, 41.

Any help would be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [August 18, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976/2 "2009-08-18T23:32:30Z")

</div>

Alpha B. wrote:

> Hi all,
> 
> I’m trying to figure out why cap deploy:web:disable isn’t working for my  
> server.  
> […]

I’ve never gotten that to work either. I’m not sure why.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [August 18, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976/3 "2009-08-18T22:45:57Z")

</div>

Just as some added info:

in apache2.conf I have the following for passenger and rails:

LoadModule passenger\_module  
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod\_passenger.so  
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4  
PassengerRuby /usr/bin/ruby1.8  
RailsAllowModRewrite on

The updated virtual file I am using is located here:

[http://pastie.org/587697](http://pastie.org/587697)

When I issue cap deploy:web:disable

I can confirm that a maintenance.html file is written to:

/path/to/production/mydomain.com/current/public/system/maintenance.html

But, no redirects to that page occur when my site is clicked…

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [August 19, 2009, 2:54am UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976/4 "2009-08-19T02:54:04Z")

</div>

hitch wrote:

> Seems like you might need a  
> RewriteEngine on  
> directive before that first RewriteCond
> 
> On Aug 18, 2:32ï¿½pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-

Thank you Hitch!

That did the trick!

---

<div class="post-metadata">

**Author:** ![elricstorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/da6949/32.png) [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Post date:** [August 19, 2009, 2:46am UTC](https://www.ruby-forum.com/t/capistrano-deploydisable-doesnt-work/173976/5 "2009-08-19T02:46:55Z")

</div>

Seems like you might need a  
RewriteEngine on  
directive before that first RewriteCond

On Aug 18, 2:32 pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-
