Apache Error Messages
Contents |
generic error responses in the event of 4xx or 5xx HTTP status codes, these responses are rather stark, php error messages uninformative, and can be intimidating to site users. You may wish to mysql error messages provide custom error responses which are either friendlier, or in some language other than English, or perhaps which are tomcat error messages styled more in line with your site layout. Customized error responses can be defined for any HTTP status code designated as an error condition - that is, any 4xx or apache 404 5xx status. Additionally, a set of values are provided, so that the error document can be customized further based on the values of these variables, using Server Side Includes. Or, you can have error conditions handled by a cgi program, or other dynamic handler (PHP, mod_perl, etc) which makes use of these variables. Configuration Available Variables Customizing Error Responses Multi Language
Apache Error 302
Custom Error Documents See alsoComments Configuration Custom error documents are configured using the ErrorDocument directive, which may be used in global, virtualhost, or directory context. It may be used in .htaccess files if AllowOverride is set to FileInfo. ErrorDocument 500 "Sorry, our script crashed. Oh dear" ErrorDocument 500 /cgi-bin/crash-recover ErrorDocument 500 http://error.example.com/server_error.html ErrorDocument 404 /errors/not_found.html ErrorDocument 401 /subscription/how_to_subscribe.html The syntax of the ErrorDocument directive is: ErrorDocument <3-digit-code>
referer DNT X-Forwarded-For Status codes 301 Moved Permanently 302 Found 303 See Other 403 Forbidden 404 Not Found 451 Unavailable For Legal Reasons v t e This is a
Apache Server Error Codes
list of Hypertext Transfer Protocol (HTTP) response status codes. It includes codes apache custom error pages from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes. The first digit of apache errordocument the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum. The phrases used are the standard wordings, but any human-readable https://httpd.apache.org/docs/2.4/custom-error.html alternative can be provided. Unless otherwise stated, the status code is part of the HTTP/1.1 standard (RFC 7231).[1] The Internet Assigned Numbers Authority (IANA) maintains the official registry of HTTP status codes.[2] Microsoft IIS sometimes uses additional decimal sub-codes to provide more specific information,[3] but not all of those are here (note that these sub-codes only appear in the response payload and in https://en.wikipedia.org/wiki/List_of_HTTP_status_codes documentation; not in the place of an actual HTTP status code). Contents 1 1xx Informational 2 2xx Success 3 3xx Redirection 4 4xx Client Error 5 5xx Server Error 6 Unofficial codes 6.1 Internet Information Services 6.2 nginx 6.3 CloudFlare 7 See also 8 Notes 9 References 10 External links 1xx Informational[edit] Request received, continuing process. This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Since HTTP/1.0 did not define any 1xx status codes, servers must not[note 1] send a 1xx response to an HTTP/1.0 client except under experimental conditions.[4] 100 Continue The server has received the request headers and the client should proceed to send the request body (in the case of a request for which a body needs to be sent; for example, a POST request). Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request and receive a
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: Mitchell Anicas https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-common-http-error-codes Subscribe Subscribed Share Contents Contents We hope you find this tutorial helpful. In http://www.4webhelp.net/tutorials/misc/errors.php addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more → 10 How To Troubleshoot Common HTTP Error Codes Posted Oct 24, 2014 77.9k views FAQ Apache Nginx Introduction When accessing a web server or application, every HTTP request that is received by a server is responded to error messages with an HTTP status code. HTTP status codes are three-digit codes, and are grouped into five different classes. The class of a status code can be quickly identified by its first digit: 1xx: Informational 2xx: Success 3xx: Redirection 4xx: Client Error 5xx: Server Error This guide focuses on identifying and troubleshooting the most commonly encountered HTTP error codes, i.e. 4xx and 5xx status codes, from a apache error messages system administrator's perspective. There are many situations that could cause a web server to respond to a request with a particular error code--we will cover common potential causes and solutions. Client and Server Error Overview Client errors, or HTTP status codes from 400 to 499, are the result of HTTP requests sent by a user client (i.e. a web browser or other HTTP client). Even though these types of errors are client-related, it is often useful to know which error code a user is encountering to determine if the potential issue can be fixed by server configuration. Server errors, or HTTP status codes from 500 to 599, are returned by a web server when it is aware that an error has occurred or is otherwise not able to process the request. General Troubleshooting Tips When using a web browser to test a web server, refresh the browser after making server changes Check server logs for more details about how the server is handling the requests. For example, web servers such as Apache or Nginx produce two files called access.log and error.log that can be scanned for relevant information Keep in mind that HTTP status code de
you upgrade your browser to one which is compatible with CSS. For more information, please visit our Browser Upgrade page. Home FAQs Forums Links News Online Tools phpBB Scripts Tutorials: Apache CSS Databases Graphics Hosting HTML & XHTML Miscellaneous Perl PHP About us Contact us Contribute Credits Link to us News: RIP Netscape Navigator IP Atlas Updated Tutorial comment spam Forum problems phpBB Upgrades Search: Creating Custom Error Messages in Apache by eKstreme Last updated: 02/05/2012 Write a tutorial for us Bookmark this tutorial Print this tutorial Comment on this tutorial In order to have a complete understanding of what a .htaccess file is, I suggest that you also read our Control File Defaults tutorial and our Password Protection tutorial. Introduction The .htaccess file is a file found in Apache servers that allows you to manipulate the behaviour of the server. A very common use is to create custom error messages for server errors. Examples of such errors are "404 Not Found" (say when you click on a broken link), and the "500 Internal Server Error" (a script failed). Most hosts allow you to have your own .htaccess file, and so now we will look at only one of the things we can do with a custom .htaccess. Some quick notes before we start: under Windows, you cannot save a file with the name of ".htaccess". An easy trick is to create a file called htaccess.txt and edit that. Uploading of the file (regardless of its name) must be done in TEXT/ASCII mode (not BINARY). Finally, under Unix, any file that starts with a '.' is invisible, so when you upload your file, you may not see it. If you uploaded a file called htaccess.txt, just rename it to .htaccess using your FTP client. Custom Error Messages What you can do with .htaccess is tell the server to display a special page to the user in case of an error. This page should, ideally, tell the user that something is wrong, down-play the fact that someone messed up (probably you as the webmaster!), and also provide a set of links to the major sections of the site, so the user can at least look for what is missing. Another nice use is to include a search form on the 404 page. You can also tell the server to run a CGI script, instead of simply displaying a static page. If you do this, you can tell the script to log the error for you, or the script can send you an email about the error. So how do we implement this? Since the .htaccess file is a simple text file, you simply add a line of text to the file, one for each error you want to trap. The general format is: ErrorDocument 3DigitErrorCode /path/to/your/error/file/or/script The 3