0

I am using Capistrano,Apache 2 and Passenger to rollout my rails applications on a weekly basis, this works well. Recently I encountered an error where the passenger side of the deployment exposed my stack trace and my server information, I was able to do a rollback and it was only exposed for a moment, but a moment is still venerable.

So:

  • How do I disable this?, I have see this so that might answer that question but it leads to more:
    • I want to use some Rails Custom error pages to display errors for all the 500's and the 404, essentially if passenger explodes or you encounter a broken route (so a rails error) I want you to see a custom error page, not a rails error page, not a passenger error page.v I was reading this documentation on passenger and apache but it didn't provide any examples of how you might do this.

My goal is that if for some reason you encounter a rails error or a deployment goes wrong that you don't see the rails stack trace or the passenger stack trace. that you see, instead, a custom error page.

Community
  • 1
  • 1
SeekingTruth
  • 1,044
  • 2
  • 15
  • 23

1 Answers1

0

Nice thing to do during a deployment process is to redirect any requests to a static page saying "We'll be back in 10 minutes". You can follow this answer to do it manually or use a gem capistrano/maintenance. The idea is that you'd have a capistrano task. By running this task a static html page is being created on the server in public directory. Apache is configured to watch whether this page exists, and if it does - all requests are redirected to it with 503 status.

Community
  • 1
  • 1
Michael Radionov
  • 12,859
  • 1
  • 55
  • 72
  • that doesnt help though if you are just wondering through the app and then boom you hit a route not found rails stack trace error. I want you to see an error page but not a stack trace page. – SeekingTruth Oct 14 '14 at 22:06
  • That has got nothing to do with Phusion Passenger. It's handled by Rails. You need to disable the Rails error page. It's already disabled by default in production mode. The production error page (which doesn't contain a stack trace) is public/500.html and public/404.html. – Hongli Oct 18 '14 at 20:17