Problems with Capistrano's web:disable command

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 ( I can see
the maintenance page in all its glory.

However when I access any url which is not the above one e.g. (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.

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.

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

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

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

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