Browsing articles tagged with "customerrors - Admins Goodies"
Jun 28, 2012
tom

How to create an Apache error page for redirected Zope

I have some virtual hosts which are redirections to Zope server processes: RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/%{HTTP_HOST}:80/theroot/VirtualHostRoot/$1 [L,P] Of course, if the Zope process is not running, the redirection fails. This can happen during restart of the instance (e.g. for an update), or for development/testing instances which are not supposed to run all the time. I’d like to have a friendly message in this case. Thus, for the sole purpose of error handling, I defined a DocumentRoot: [...]

Continue Reading »
Mar 9, 2012
tom

Displaying custom error pages on different VirtualHosts in Apache

I have a reverse proxy Apache that is moving the request to a Tomcat servlet. The configuration on the Virtual Host in Apache is: <VirtualHost 10.10.10.10:80> ProxyPass /Site1/ServLet1 http://1.1.1.1/Site1/ServLet1 ProxyPassReverse /Site1/ServLet1 http://1.1.1.1//Site1/ServLet1ProxyPass /Site2/ServLet2 http://2.2.2.2/Site2/ServLet2 ProxyPassReverse /Site2/ServLet2 http://2.2.2.2/Site1/ServLet1 </VirtualHost> Essentially, if it comes to 10.10.10.10 and requests /Site1/ServLet1, route it to /Site1/ServLet1. if I add <VirtualHost 10.10.10.10:80> ProxyPass /Site1/ServLet1 http://1.1.1.1/Site1/ServLet1 ProxyPassReverse /Site1/ServLet1 http://1.1.1.1//Site1/ServLet1 ErrorDocument 404 /customerrors/site1/404.htmlProxyPass /Site2/ServLet2 http://2.2.2.2/Site2/ServLet2 ProxyPassReverse /Site2/ServLet2 http://2.2.2.2/Site1/ServLet1 </VirtualHost> so it will show [...]

Continue Reading »
Jan 29, 2012
tom

nginx custom 404 error page for virtual host

I’m running a few virtual hosts off nginx, and I would like them to each have their own custom 404 pages. Each virtual host has their own nginx.conf that I include my global nginx.conf. Inside the config file for the particular virtual host that I can’t currently get to work right, the configuration block looks like this: server{ listen 80; server_name www.foo.com; expires 1M; access_log /srv/www/foo/logs/acces.log; error_log /srv/www/foo/logs/error.log; error_page 404 /404.html; location / { root [...]

Continue Reading »
Nov 19, 2011
tom

Custom 403 Error page not showing

I want to restrict access to certain folders (includes, xml and logs for example) and so I’ve given them 700 permissions, and all files within them 600 permissions. Firstly, is this the right approach to restrict access? I have a .htaccess file in my root that handles rewriting and error documents. There are two pages in the root – 403.php and 404.php – for 403 and 404 errors. And I have these rules added to [...]

Continue Reading »
Aug 20, 2011
tom

IIS 404 custom error

I’ve deployed an ASP.NET 3.5 app to a 64bit Windows 2003 R2 server. In the web.config I have the following <customErrors mode=”RemoteOnly” defaultRedirect=”/404/”> <error statusCode=”404″ redirect=”/404/”/> <error statusCode=”500″ redirect=”/500/”/> </customErrors> In the website properties in IIS Manager I have set the 404 and 500 errors to Type = “URL” and the same URLs as in the web.config. I have a wildcard application map to the .NET 2.0 aspnet_isapi.dll with “Verify file exists” turned off. If [...]

Continue Reading »
Aug 11, 2011
tom

Custom error pages on Apache Tomcat

I’m running an Apache Tomcat server with 2 custom servlets. The tree structure looks like: $CATALINA_HOME/webapps/ ROOT/ WEB-INF/ servlet1/ META-INF/ WEB-INF/ servlet2/ META-INF/ WEB-INF/ I am trying to add a custom error html page for each servlet that will be displayed on error 400, 404 and when there is an exception on the servlet (such as the information that was supposed to be sent to the servlet on the http request is not there) I [...]

Continue Reading »
Aug 9, 2011
tom

Should pretty error pages be served with the correct status codes?

I noticed that, say, goolge’s 404 page returns a 404 status (http://www.google.com/404.html) while github’s returns 200 (https://github.com/404.html). Should error pages (even 503s, etc.) always be served with the correct status codes? Or should front end servers intercept them and display 200ed error pages? Error pages should always be served with the correct status codes. Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers [...]

Continue Reading »
Aug 9, 2011
tom

Disabling IIS 7.5 server error response for 5xx and 4xx HTTP status codes

Is there any way to prevent IIS from automatically overriding the output of a web app that is returning a status code in the 500 or 400 range? Just as an example, in ColdFusion I can create the following page: <cfheader statuscode=”500″ statustext=”Error”> Sorry, an error occurred. The behavior should be that I see a page that says “Sorry, an error occurred.” and see in the headers that the status code is 500. Instead, I [...]

Continue Reading »
Aug 9, 2011
tom

IIS7 error config and remote errors

Certain IIS7/7.5 500.19 configuration errors only render on a browser running on the local server. This appears to happen regardless of whether I set <httpErrors errorMode=”Detailed” existingResponse=”PassThrough” /> in the system.webServer section of a site’s web.config file (or even globally for that matter). For example, I had a developer who reported that he was just getting the generic IIS7 500 error page: This was happening even though he had the following configured in his web.config: [...]

Continue Reading »