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.