# Problems with Capistrano's web:disable command

**URL:** <https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541>\
**Category:** Deployment\
**Created:** [February 22, 2011, 4:55pm UTC](https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541 "2011-02-22T16:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 22, 2011, 4:55pm UTC](https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541/1 "2011-02-22T16:55:31Z")

</div>

I’m currently experimenting with Capistrano to deploy my rails app from  
my host machine to a Ubuntu server running within VirtualBox.

It works great, but I am having trouble with the command “cap  
web:disable” which writes a maintenance page (maintenance.html) to the  
system folder of my app’s public directory.

I am using Apache and have enabled mod\_rewrite.  
I have also created a .htaccess file in my app’s public directory.

When I access the base url of my app ([http://192.168.178.33/](http://192.168.178.33/)) I can see  
the maintenance page in all its glory.

However when I access any url which is not the above one e.g.  
[http://192.168.178.33/hello](http://192.168.178.33/hello) (the ‘hello’ controller does exist and is  
normally viewable) I get a 404 error message served by rails.

If I look in my production log then I see:  
ActionController::RoutingError (No route matches  
“/system/maintenance.html” with {:method=\>:get})

My .htaccess file looks like this:  
ErrorDocument 503 /system/maintenance.html  
RewriteEngine On  
RewriteCond %{REQUEST\_URI} !.(css|gif|jpg|png)$  
RewriteCond %{DOCUMENT\_ROOT}/system/maintenance.html -f  
RewriteCond %{SCRIPT\_FILENAME} !maintenance.html  
RewriteRule ^.\*$ - [redirect=503,last]

Can anyone help me sort this out?

I have tried googling for a solution, as well as replacing the various  
paths above with full paths.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [February 22, 2011, 9:35pm UTC](https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541/2 "2011-02-22T21:35:01Z")

</div>

Answered my own question.  
In case it helps anyone else, here’s the solution / workaround:

Stick the contents of the htaccess file in the VirtualHost file and then  
delete the htaccess file.

[https://groups.google.com/group/phusion-passenger/browse\_thread/thread/0b49a45a4887137f](https://groups.google.com/group/phusion-passenger/browse_thread/thread/0b49a45a4887137f)

---

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [February 22, 2011, 10:07pm UTC](https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541/3 "2011-02-22T22:07:40Z")

</div>

As a point of interest, it is also possible to solve this problem by  
adding the following line to the top of htaccess file:

PassengerAppRoot /path/to/app/public

This will make passenger look in the correct place for  
“maintenance.html”

This is my preferred solution as it doesn’t involve restarting appache.

---

<div class="post-metadata">

**Author:** ![jimb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jimb](https://www.ruby-forum.com/u/jimb)\
**Post date:** [December 4, 2011, 10:06am UTC](https://www.ruby-forum.com/t/problems-with-capistranos-web-disable-command/203541/4 "2011-12-04T10:06:05Z")

</div>

sir plz can help me how to make banner for my website ( it is for  
learning Arabic language),i request you to help me in this regard

> **[Teaching Arabic as a foreign language since 2006](http://www.lalinguaarabapertutti.com)**
>
> Learn Arabic language (Modern Standard Arabic and Syrian Colloquial Arabic) with an experienced teacher  (see the students’ comments). Try the first lesson for free (online)  Also available: online Dissertation...
