Maintenance pages?

0 views
Skip to first unread message

David

unread,
Feb 14, 2008, 11:23:19 AM2/14/08
to SwitchPipe
Anyone have a thought on the best way to support capistrano - styled
maintenance pages with switchpipe. I have a few switchpipe rails apps
that are deployed using capistrano. I'd like to run cap
deploy:web:disable and have the maintenance page for that app appear.
The current apache formula uses mod_rewrite and depends on testing the
document root. With switchpipe, there really is no per-app doc root.
Hope this isn't too much of a noob question.

Peter Cooper

unread,
Feb 14, 2008, 12:06:08 PM2/14/08
to SwitchPipe
I must admit I am not too familiar with Capistrano and what this
maintenance page is. Is it a situation where you want to take the app
down and show a maintenance page? If so, is it working by getting
Apache to load a static HTML page if it exists in the app's public
folder? How does it work?

In any case, this sounds like either something that can be solved
already /or/ by a customized plugin, a plugin system being one of next
features due to come along for SwitchPipe :)

Cheers,
Pete

Jason Stirk

unread,
Feb 14, 2008, 6:40:33 PM2/14/08
to SwitchPipe
David,

I'm not entirely familiar with Capistrano per-se, but I do use a maintenance place holder page in Apache.

Most Mongrel configuration examples for Apache show how to do this - I think most of them work in the way that Capistrano expects. So, I suggest you check them out to get some idea - unfortunately I'm not familiar with exactly how Cap expects it.

In my case, I just use :
#Check for maintenance file.
RewriteCond %{DOCUMENT_ROOT}/maintenance
.html -f
RewriteRule . /maintenance.html [L]

That in my VirtualHost block redirects all requests to maintenance.html if it exists.

This works really well for me, as I already have Apache configured to handle all the static content for my Rails apps for performance reasons. As such, I do have per-app document roots all set up, and just point SwitchPipe at them.

How do you mean "really is no per-app doc root"? Do you mean your apps are stored in non-typical spots in your filesystem and Apache doesn't have access? If so then I can imagine that would cause you some problems with trying to get the rewrite conditions to work.

Hope this helps.

Best regards,
Jason
Reply all
Reply to author
Forward
0 new messages