Forum: Rails deployment Problems with Capistrano's web:disable command

Cb880dd8c8c209924ebb57edbb4fcd06?d=identicon&s=25 Jim Burgess (jim_in_germany)
on 2011-02-22 16:55
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/) 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 (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.
Cb880dd8c8c209924ebb57edbb4fcd06?d=identicon&s=25 Jim Burgess (jim_in_germany)
on 2011-02-22 21:35
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/...
Cb880dd8c8c209924ebb57edbb4fcd06?d=identicon&s=25 Jim Burgess (jim_in_germany)
on 2011-02-22 22:07
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.
9e41594bffc8a77deeecefe1aa3a79ab?d=identicon&s=25 sky girl (skygirl20)
on 2011-12-04 10:06
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
http://www.lalinguaarabapertutti.com
This topic is locked and can not be replied to.