Rails Passenger Error Page
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or
Passenger Friendly Error Pages Apache
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss passengerfriendlyerrorpages Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only
Passenger Friendly Error Pages Nginx
takes a minute: Sign up Disable the Phusion Passenger (Standalone) error page on AWS Elastic Beanstalk? up vote 5 down vote favorite When deploying application to Elastic Beanstalk, is it possible to disable the error page that is shown by Phusion passenger nginx config Passenger (Standalone)? Especially in production. This page includes a stack trace as well as exposed environment variables ... which is dangerous in my opinion. Quick way to reproduce this would be introduce a syntax error (it's not the only way). I can see here (link) that it's possible ... just not sure how you'd do the same on EB. To avoid broken links in the future, I'll just quote the conversation here ... one guy asks: I seem to recall reading phusion passenger somewhere that it's possible to disable the passenger boot error page that shows if you're missing gems, etc. If I recall correctly, I think the Phusion guys were saying that the default behavior in the production environment would be to suppress this error page that shows the stack trace, etc. Is there a way to disable this error page with the current version of Passenger? To which one of the Phusion guys reply ... Right now you can just edit the templates in lib/phusion_passenger/templates. All errors are also logged to the web server log file. While the response is a positive sign, it doesn't really solve my problem ... which is how to do it on EB and we all (almost) know that EB is a bit more tight-boxed that your typical self administered server. amazon-web-services passenger elastic-beanstalk share|improve this question edited May 30 '14 at 10:23 asked May 26 '14 at 4:56 King'ori Maina 2,20011124 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote You need to add a Passenger directive to prevent Passenger from exposing potentially exploitable details about your web server. The way to do this is to add a directive on your web server configuration to prevent Passenger from showing a backtrace and dump environment variables on your users. For instance if your Rails app is deployed using Apache then you just need to add the following directive on your Virtualhost
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to set a custom error page with passenger and apache up vote 0 down vote favorite I am using Capistrano,Apache 2 and Passenger to rollout my rails applications on a weekly basis, http://stackoverflow.com/questions/23862952/disable-the-phusion-passenger-standalone-error-page-on-aws-elastic-beanstalk 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 http://stackoverflow.com/questions/26368302/how-to-set-a-custom-error-page-with-passenger-and-apache 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. ruby-on-rails apache passenger share|improve this question asked Oct 14 '14 at 18:58 SeekingTruth 245315 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote 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. share|improve this answer answered Oct 14 '14 at 21:05 Michael Radionov 5,19411643 that doesnt help though if you are just wondering through the
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring http://serverfault.com/questions/75811/customer-passenger-error-pages developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how https://www.digitalocean.com/community/tutorials/how-to-configure-apache-to-use-custom-error-pages-on-ubuntu-14-04 it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Customer Passenger Error Pages up vote 2 down vote favorite How do you replace the Passenger Application failed to error page load error messages. They are lovely, but I'd rather not display them when we move our application to production. It'd be better to just show them on the dev box and maintenance page on the live site. For clarification, this is the call stack page passenger displays when your rails app fails to load. I'd rather not modify the passenger template files directly. Passenger doesn't seem to be respecting: ErrorDocument 500 /500.html apache-2.2 ruby-on-rails phusion-passenger share|improve this question asked Oct passenger friendly error 19 '09 at 7:08 Adam 161115 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote You have to include the Passenger directive: PassengerFriendlyErrorPages off additionally to the ErrorDocument directives for Apache that you want, in order to disable the Passenger error page. share|improve this answer answered Jul 12 '11 at 18:52 Carlos Paramio 1212 add a comment| up vote 1 down vote If it's the 500 error you're getting / wanting to show something different, you should be able to just change the 500.html page in your rails app under the public folder. Sorry if you already, but that sounds like what you're trying to change. share|improve this answer answered Oct 24 '09 at 23:52 Stephen Korecky add a comment| up vote 1 down vote /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.4/lib/phusion_passenger/templates (Your lib/gem path may vary.) share|improve this answer answered Nov 2 '09 at 12:52 Teflon Ted 300517 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged apache-2.2 ruby-on-rails phusion-passenger or ask your own question. asked 7 years ago viewed 1461 times active 4 years ago Blog Stack Overflow Podcast #
In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: Justin Ellingwood Subscribe Subscribed Share Contents Contents We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more → 6 How To Configure Apache to Use Custom Error Pages on Ubuntu 14.04 Posted Jun 9, 2015 48.3k views Apache Ubuntu Introduction Apache is the most popular web server in the world. It is well-supported, feature-rich, and flexible. When designing your web pages, it is often helpful to customize every piece of content that your users will see. This includes error pages for when they request content that is not available. In this guide, we'll demonstrate how to configure Apache to use custom error pages on Ubuntu 14.04. Prerequisites To get started on with this guide, you will need a non-root user with sudo privileges. You can set up a user of this type by following along with our initial set up guide for Ubuntu 14.04. You will also need to have Apache installed on your system. Learn how to set this up by following the first step of this guide. Creating Your Custom Error Pages We will create a few custom error pages for demonstration purposes, but your custom pages will obviously be different. We will put our custom error pages in the /var/www/html directory where Ubuntu's Apache installation sets its default document root. We'll make a page for 404 errors called custom_404.html and one for general 500-level errors called custom_50x.html. You can use the following lines if you are just testing. Otherwise, put your own content in these locations:
- echo "
Error 404: Not found :-(
" | sudo tee /var