Apache Custom Proxy Error Page
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Apache Custom 404 Error Page
policies of this site About Us Learn more about Stack Overflow the apache custom 500 error page company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered apache custom error log virtualhost 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 it works: Anybody
Apache Set 404 Page
can ask a question Anybody can answer The best answers are voted up and rise to the top Apache reverse proxy error page when proxied server is down up vote 2 down vote favorite I am using Apache2 as a reverse proxy for tomcat, my configuration being something like: ProxyRequests Off ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ My question is: can I
Php Custom Error Page
configure Apache to show up a courtesy page (an "under construction" HTML static page) whenever Tomcat is down? apache-2.2 reverse-proxy share|improve this question edited May 6 '11 at 8:17 Hangin on in quiet desperation 88k9113199 asked May 6 '11 at 8:15 Overflow 1313 add a comment| 5 Answers 5 active oldest votes up vote 4 down vote accepted You can use the Apache ErrorDocument directive to do this. You should use a URL to point to your ErrorDocument otherwise if you use a filesystem reference you will get an additional 503 whilst trying to find it. ErrorDocument 503 http://somehost.tld/errors/503.html share|improve this answer answered May 6 '11 at 8:54 community wiki Hangin on in quiet desperation 1 That is correct, since I am proxying all the pages starting from "/", so there won't be any web server actually servicing an error page of the type "/var/www/html/error/gonefishing.html" –Overflow May 13 '11 at 11:29 add a comment| up vote 2 down vote Apache will throw a 503 "Service unavailable" error when it can't connect to Tomcat. You could just create a "nice" 503 error page. Err
minute readOut Of Date tomcat custom error page WarningThis article was published on 07/02/2012, this
Apache Custom Error Pages
means the content may be out of date or no longer apache errordocument relevant. You should verify that the technical information in this article is still up to date before relying http://serverfault.com/questions/266924/apache-reverse-proxy-error-page-when-proxied-server-is-down upon it for your own purposes.When the underlying server is not reachable, Apache generates an ugly 503 Status message. To change that and inform the users that our server will be up soon again (due to https://www.stefanwienert.de/blog/2012/02/07/apache-proxy-pass-custom-503-error-document/ a deployment): # Vhost/http conf DocumentRoot /home/stefan/repos/empfehlungsbund/public ProxyPreserveHost On # if you running in production, maybe handling the assets by apache self, instead # of thin/unicorn etc. # ProxyPass /assets ! # Here the interesting lines: ProxyPass /error-documents ! ErrorDocument 503 /error-documents/503.html Alias /error-documents /home/stefan/repos/empfehlungsbund/public # BTW: apache does not allow encoded slashes in URL, # it will always generate 404. We used base64 encoded urls, which included this problem, # to fix: AllowEncodedSlashes on Reposted from notes.it-jobs-und-stellen.de Related posts← Effektive Corporate Website mit Drupal und Installationsprofilen11/01/2012Frameworkunabhängige Fehlerberichtung mit PHP und Redmine →08/02/2012Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus Impressum
here for a quick overview of the site Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/4341263/custom-error-page-in-apache2-for-401 have Meta Discuss the workings and policies of this site About http://heiner-bach.blogspot.com/2010/01/costum-503-error-page-for-apache-with.html 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 4.7 error page million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Custom error page in Apache2 for 401 up vote 8 down vote favorite Here's the relevant part of the .htaccess file: AuthUserFile /var/www/mywebsite/.htpasswd AuthGroupFile /dev/null AuthName protected AuthType Basic Require valid-user ErrorDocument 400 /var/www/errors/index.html ErrorDocument 401 /var/www/errors/index.html ErrorDocument custom error page 403 /var/www/errors/index.html ErrorDocument 404 /var/www/errors/index.html ErrorDocument 500 /var/www/errors/index.html Docuement root is set to /var/www/mywebsite/web, it's on of many vhosts. I can navigate to the index.html page. All I'm seeing is the generic Apache 401 page, any thoughts. EDIT: This is the error message in my browser: Authorization Required This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. Additionally, a 401 Authorization Required error was encountered while trying to use an ErrorDocument to handle the request. Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch Server at www.dirbe.com Port 80 apache apache2 custom-error-pages share|improve this question edited Dec 3 '10 at 0:34 asked Dec 2 '10 at 23:58 Parris Varney 6,47663056 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted Make sure that /var/www/errors is readable by the apache user and include this in your apache
following situation:We have an apache proxy that serves a bunch of internal webservices via mod_proxy.These webservices all have nice costum error pages esp. for the classical 404 - page not found.Every now and then one of these Servers is not reachable, due to maintenance or heavy load. If this happens, the apache running mod_proxy will show an ugly standard 503 error message.So lets get rid of that:The first thought is putting an ErrorDocument directive in the virtual host definition:
...servername and other fancy stuff...
ProxyPass / http://some_internal_server/
ProxyPassReverse / http://some_internal_server/
ErrorDocument 503 /my_cool_503_error.html
Listen *:81
DocumentRoot /var/www/
...servername and other fancy stuff...
ProxyPass /proxy-error/ http://localhost:81/proxy-error/
ProxyPassReverse /proxy-error http://localhost:81/proxy-error/
ProxyPass / http://some_internal_server/
ProxyPassReverse / http://some_internal_server/
ErrorDocument 503 /proxy-error/my_cool_503_error.html