Locating your log file on your server.
Most logs files in Ubuntu are stored in /var/log/ and the folders under /var/log/ . To find all logs on your server got to a terminal window and type
locate log
then hit enter and all logs on your server will be listed.
In Particular have a look at /var/log/apache2/access.log and /var/log/apache2/error.log depending on the server your site is these logs may be in a different location.
In Virtualmin the job is much easer. After you have logged in to your Virtualmin console select Virtualmin> Logs and Reports> and then either select Apache Access Log or Apache Error Log and you will get a list of the last x number of records.
Finding the Apache response codes in your log file.
When checking your log files you will come across two sets of numbers that don’t seem to stand for anything. Have a look at these two example of standard log file entry.
ltr
208.115.111.67 – – [28/May/2011:00:44:05 +0800] “GET /robots.txt HTTP/1.1” 200 358 “-” “Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)”
208.115.111.67 – – [28/May/2011:01:33:53 +0800] “GET /WebDesign/WebDesign.php HTTP/1.1” 200 19388 “-” “Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)”
For this exercise ignore ever thing up to and including “GET /robots.txt HTTP/1.1” in the first log entry and “GET /WebDesign/WebDesign.php HTTP/1.1” in the second. What we are interested in here is the 200 358 and the 200 19388 in the two lines consecutively. To begin with I will deal with the second number first because it requires the shortest explanation.
In each case the second number represents the amount of data passed from your website (the server) to the computer requesting the information (the client). In other words the page passed back to the computer making the request or the client EG an error page. The first number is the Apache response code or the code for, what action the server took to the request from the client.
Response codes can be divided into 5 categories.
Response codes categories
1xx: | Redirection | Further action must be taken in order to complete the request |
2xx: | Success | The action was successfully received, understood, and accepted |
3xx: | Redirection | Further action must be taken in order to complete the request |
4xx: | Client Error | The request contains bad syntax or cannot be fulfilled |
5xx: | Server Error | The server failed to full fill an apparently valid request |
* | NOTE | Not all numbers in any category have been used. |
100-199 Continue with Client Requests.
100 | Continue | Means that the server has received the request and that the client should proceed to send the request body (in the case of a POST request). |
101 | Switching Protocols | Means the computer requesting the information has asked the server to switch protocols and the server is acknowledging that it will. |
102 | Processing (WebDAV) | A WebDAV request may contain many sub-requests so it may take a long time to complete the request. This code indicates that the server has received the request and is processing it. In laymen terms “please hold the line”. |
200-299 Successful Client Requests.
200 | OK | Standard response for success. |
201 | Created | A confirmation that a new page has been created. |
202 | Accepted | The client’s request was accepted, but it has not been processed yet. |
203 | Non-Authoritative Information | The server successfully processed the request, but is returning information that may be from another server. |
204 | No Content | The server has successfully processed the request, but there is no content to return. |
205 | Reset Content | The server has processed the request successfully, but is not returning any content. Unlike a 204 response this response requires that the client refresh the browser. |
206 | Partial Content | The requested file wasn’t downloaded entirely. The server is delivering only part of the requested file or page due to a range header (partial request – range of bytes) sent by the client. This is used by tools like wget to enable resuming of interrupted downloads, or split a download into multiple simultaneous streams. This response code is also returned when the user clicks the stop button before a page is loaded. |
207 | Multi-Status | The message body that follows is an XML message and can contain a number of separate response codes, depending on how many sub-requests were made. |
208 | Already Reported | The members of a DAV binding have already been enumerated in a previous reply to this request, and are not being included again. See also 102 Processing (WebDAV) above. |
226 | IM Used | The server has fulfilled a GET request for the file or page, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. A response received with a status code of 226 MAY be used by a cache, in conjunction with a cache entry for the base instance, to create a cache entry for the current instance. |
300-399 Client Request Redirected.
300 | Multiple Choices | Indicates multiple options for the file or page that the client may follow. The requested address refers to more than one file. Depending on how the server is configured, you get an error or a choice of which page you want. For instance, it could be used to present different format options for video, list files with different extensions, or word sense disambiguation. |
301 | Moved Permanently | Moved Permanently This and all future requests should be directed to the new location of the file. If the server is set up properly it will automatically redirect the client to the new location of the file. |
302 | Found | The page has been found but not in the location requested by the client. The page has been moved temporarily, and the new URL is available. You should be sent there by the server. |
303 | See Other | The response to the request can be found at another URI using a GET method. When received in response to a PUT, it should be assumed that the server has received the data and the redirect should be issued with a separate GET message. |
304 | Not Modified | Not Modified Indicates the file or page has not been modified since the last requested. This code will be returned if the file has not changed since the date of the last request. Search engine robots may generate a lot of these response codes. |
305 | Use Proxy | The requested file or page MUST be accessed through the proxy given by the Location field. The Location field gives the URI of the proxy. The recipient is expected to repeat this single request via the proxy. 305 responses MUST only be generated by origin servers. Primarily for security reasons many clients such as Firefox and Internet Explorer do not correctly handle responses with this responses code. |
306 | Switch Proxy | No longer used. Originally meant “Subsequent requests should use the specified proxy”. |
307 | Temporary Redirect | In this case, the request should be repeated with another URI however, future requests should still use the original URI. |
308 | Permanent Redirect (proposed) | The request, and all future requests should be repeated using another URI. Response 307 and response 308 (as proposed) parallel the behaviours of 302 and 301, but do not allow the HTTP method to change. So, for example, submitting a form to a permanently redirected file or page may continue smoothly. |
400-499 Client Request Errors.
400 | Bad Request | There is a syntax error in the clients request and the request has been denied. |
401 | Unauthorised | The requesting header sent by the client did not contain the necessary authentication codes, and the client is denied access. |
402 | Payment Required Reserved for future use. | The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, but that has not happened, and this code is not usually used. As an example of its use, however, Apple’s MobileMe service generates a 402 error if the MobileMe account is delinquent. In addition, YouTube uses this status if a particular IP address has made excessive requests, and requires the person to enter a CAPTCHA. |
403 | Forbidden | The request was a valid request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference. On servers where authentication is required, this commonly means that the provided credentials were successfully authenticated but that the credentials still do not grant the client permission to access the file or page (e.g. a recognized user attempting to access that is restricted to their access level). |
404 | Not Found | The requested file or page could not be found but may be available again in the future. Possibly because the file or page was deleted, or never existed. Sometimes caused by misspellings of URLs. Subsequent requests by the client are permissible. |
405 | Method Not Allowed | A request was made of a file or page using a request method not supported by that file or page for example using a GET on a form which requires data to be presented via POST, or using PUT on a read-only file or page. The method the client is using to access the file is not allowed. |
406 | Not Acceptable | The requested file or page is only capable of generating content not acceptable according to the Accept headers sent in the request. The requested file exists but cannot be used as the client system doesn’t understand the format the file is configured for. |
407 | Proxy Authentication Required | The requested file or page is only capable of generating content not acceptable according to the Accept headers sent in the request. The requested file exists but cannot be used as the client system doesn’t understand the format the file is configured for. |
408 | Request Timeout | The server timed out waiting for the request. According to W3 HTTP specifications: “The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.” Request. The server took longer than its allowed time to process the request. Often caused by heavy net traffic. |
409 | Conflict | Indicates that the request could not be processed because of a conflict in the request, such as an edit conflict or too many concurrent requests for a single file by the client. |
410 | Gone | Indicates that the file or page requested is no longer available and will not be available again. This should be used when a file or page has been intentionally removed and the file or page should be purged. Upon receiving a 410 status code, the client should not request the file or page again in the future. Clients such as search engines should remove the file or page from their indices. Most use cases do not require clients and search engines to purge the file or page, and a “404 Not Found” may be used instead. |
411 | Length Required | The request did not specify the length of its content, which is required by the requested file or page. |
412 | Precondition Failed | The server does not meet one of the preconditions that the requester put on the request. A certain configuration is required for this file to be delivered, but the client has not set this up. |
413 | Request Entity Too Large | The request is larger than the server is willing or able to process. The requested file was too big to process. |
414 | Request-URI Too Long | The URI provided was too long for the server to process. The address the client entered was longer than the server is allowed to process. |
415 | Unsupported Media Type | The client has a media type which the server does not support. For example, the client attempts to uploads an image as image.xml but the server requires that images use a different format. |
416 | Requested Range Not Satisfiable | The client has asked for a portion of the file, but the server cannot supply that portion. For example, if the client asked for a part of the file that lies beyond the end of the file. |
417 | Expectation Failed | The server cannot meet the requirements of the Expect request-header field. The expectation given in an Expect request-header field could not be met by this server, or, if the server is a proxy, the server has unambiguous evidence that the request could not be met by the next-hop server. |
418 | I’m a teapot | This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. |
420 | Enhance Your Calm (Twitter) | Not part of the HTTP standard, but returned by the Twitter Search and Trends API when the client is being rate limited. Other services may wish to implement the 429 Too Many Requests response code instead. |
422 | Unprocessable Entity (WebDAV; RFC 4918) | The request was well-formed but was unable to be followed due to semantic errors or syntax errors. |
423 | Locked (WebDAV; RFC 4918) | The file or page that the client is trying to accessed is locked by the server. |
424 | Failed Dependency (WebDAV; RFC 4918) | The request could not be performed on the file or page because the requested action depended on another action and that previous action failed. For example, if a command in a PROPPATCH method fails, then, at minimum, the rest of the commands will also fail with 424 (Failed Dependency). |
425 | Unordered Collection (Internet draft) | Defined in drafts of “WebDAV Advanced Collections Protocol” not yet in use. |
426 | Upgrade Required (RFC 2817) | The client should switch to a different protocol such as TLS/1.0. |
428 | Precondition Required (RFC 6585) | The origin server requires the request to be conditional. Its typical use is to avoid the “lost update” problem, where a client GETs a resource’s state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict. By requiring requests to be conditional, the server can assure that clients are working with the correct copies. |
429 | Too Many Requests (RFC 6585) | The user has sent too many requests in a given amount of time. Intended for use with rate limiting schemes. |
431 | Request Header Fields Too Large (RFC 6585) | The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large. |
432 | Request Thrashed | The server has received too many requests and is currently busy trying to handle them, likely causing other problems. The server’s hosed. |
444 | No Response (Nginx) | Used in Nginx logs to indicate that the server has returned no information to the client and closed the connection (useful as a deterrent for malware). |
449 | Retry With (Microsoft) | A Microsoft extension. The request should be retried after performing the appropriate action. Often search-engines or custom applications will ignore required parameters. Where no default action is appropriate, the Aviongoo website sends a “HTTP/1.1 449 Retry with valid parameters: param1, param2, . . .” response. The applications may choose to learn, or not. |
450 | Blocked by Windows Parental Controls (Microsoft) | A Microsoft extension. This error is given when Windows Parental Controls are turned on and are blocking access to the given webpage. |
451 | Unavailable For Legal Reasons (Internet draft) | Defined in the internet draft “A New HTTP Status Code for Legally-restricted File or pages”. Intended to be used when file or page access is denied for legal reasons, e.g. censorship or government-mandated blocked access. A reference to the 1953 dystopian novel Fahrenheit 451, where books are outlawed. |
451 | Redirect (Microsoft) | Used in Exchange ActiveSync if there either is a more efficient server to use or the server can’t access the users’ mailbox. The client is supposed to re-run the HTTP Autodiscovery protocol to find a better suited server. |
494 | Request Header Too Large (Nginx) | Nginx internal code similar to 431 but it was introduced earlier. |
495 | Cert Error (Nginx) | Nginx internal code used when SSL client certificate error occurred to distinguish it from 4XX in a log and an error page redirection. |
496 | No Cert (Nginx) | Nginx internal code used when client didn’t provide certificate to distinguish it from 4XX in a log and an error page redirection. |
497 | HTTP to HTTPS (Nginx) | Nginx internal code used for the plain HTTP requests that are sent to HTTPS port to distinguish it from 4XX in a log and an error page redirection. |
499 | Client Closed Request (Nginx) | Used in Nginx logs to indicate when the connection has been closed by client while the server is still processing its request, making server unable to send a status code back. |
500-599 Server Side Errors.
500 | Internal Server Error | A generic error message, given when no more specific message is suitable. EG: Internal Server Error. A nasty response that is usually caused by a problem in the Perl code on the server when a CGI program is run. |
501 | Not Implemented | The server either does not recognize the request method, or it lacks the ability to fulfill the request. In either event the request cannot be carried out by the server. |
502 | Bad Gateway | The server was acting as a gateway or proxy and received an invalid response from the upstream server. Or the server you’re trying to reach is sending back errors. |
503 | Service Unavailable | The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state. Temporarily Unavailable the service or file that is being requested is not currently available. |
504 | Gateway Timeout | The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. The gateway has timed out. Like the 408 timeout error, but this one occurs at the gateway of the server. |
505 | HTTP Version Not Supported | The server does not support the HTTP protocol version used in the request. The HTTP protocol the client is asking for is not supported. |
506 | Variant Also Negotiates (RFC 2295) | Transparent content negotiation for the request results in a circular reference. The 506 status code indicates that the server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. This proses could cause an infinite loop if the server does not stop it. |
507 | Insufficient Storage (WebDAV; RFC 4918) | The server is unable to store the representation needed to complete the request. |
508 | Loop Detected (WebDAV; RFC 5842) | The server detected an infinite loop while processing the request (sent in lieu of 208). |
509 | Bandwidth Limit Exceeded (Apache bw/limited extension) | This status code, while used by many servers, is not specified in any RFCs. |
510 | Not Extended (RFC 2774) | Further extensions to the request are required for the server to fulfill it. |
511 | Network Authentication Required (RFC 6585) | The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network (e.g. “captive portals” used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot). |
598 | Network read timeout error (Unknown) | This status code is not specified in any RFCs, but is used by Microsoft Corp. HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy. |
599 | Network connect timeout error (Unknown) | This status code is not specified in any RFCs, but is used by Microsoft Corp. HTTP proxies to signal a network connect timeout behind the proxy to a client in front of the proxy. |
Comments
2 responses to “Where to find Apache response codes and how to determine their meaning.”
[…] ← Previous […]
[…] time eg between 6 and 18 hours. Then at some random time all that any visitor is able to see is an Internal Server Error message. To anyone trying to get to your site, your site appears to be broken. For more information […]