Apache access.log format And Status Codes

Operating System: Windows XP SP2 
Server: localhost
Sample String from access.log: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
Each part of this log entry is described below.
127.0.0.1 (%h)
This is the IP address of the client (remote host) which made the request to the server. If HostnameLookups is set to On, then the server will try to determine the hostname and log it in place of the IP address. However, this configuration is not recommended since it can significantly slow the server. Instead, it is best to use a log post-processor such as logresolve to determine the hostnames. The IP address reported here is not necessarily the address of the machine at which the user is sitting. If a proxy server exists between the user and the server, this address will be the address of the proxy, rather than the originating machine.
- (%l)
The "hyphen" in the output indicates that the requested piece of information is not available. In this case, the information that is not available is the RFC 1413 identity of the client determined by identd on the clients machine. This information is highly unreliable and should almost never be used except on tightly controlled internal networks. Apache httpd will not even attempt to determine this information unless IdentityCheck is set to On.
frank (%u)
This is the userid of the person requesting the document as determined by HTTP authentication. The same value is typically provided to CGI scripts in the REMOTE_USER environment variable. If the status code for the request (see below) is 401, then this value should not be trusted because the user is not yet authenticated. If the document is not password protected, this part will be "-" just like the previous one.
[10/Oct/2000:13:55:36 -0700] (%t)
The time that the request was received. The format is:
[day/month/year:hour:minute:second zone] day = 2*digit month = 3*letter year = 4*digit hour = 2*digit minute = 2*digit second = 2*digit zone = (`+' | `-') 4*digit
It is possible to have the time displayed in another format by specifying %{format}t in the log format string, where format is as in strftime(3) from the C standard library.
"GET /apache_pb.gif HTTP/1.0" (\"%r\")
The request line from the client is given in double quotes. The request line contains a great deal of useful information. First, the method used by the client is GET. Second, the client requested the resource /apache_pb.gif, and third, the client used the protocol HTTP/1.0. It is also possible to log one or more parts of the request line independently. For example, the format string "%m %U%q %H" will log the method, path, query-string, and protocol, resulting in exactly the same output as "%r".
200 (%>s)
This is the status code that the server sends back to the client. This information is very valuable, because it reveals whether the request resulted in a successful response (codes beginning in 2), a redirection (codes beginning in 3), an error caused by the client (codes beginning in 4), or an error in the server (codes beginning in 5). The full list of possible status codes can be found in the HTTP specification (RFC2616 section 10).
2326 (%b)
The last part indicates the size of the object returned to the client, not including the response headers. If no content was returned to the client, this value will be "-". To log "0" for no content, use %B instead.
Status-Code and description [2]
"100"  ; Section 10.1.1: Continue
"101"  ; Section 10.1.2: Switching Protocols
"200"  ; Section 10.2.1: OK
"201"  ; Section 10.2.2: Created
"202"  ; Section 10.2.3: Accepted
"203"  ; Section 10.2.4: Non-Authoritative Information
"204"  ; Section 10.2.5: No Content
"205"  ; Section 10.2.6: Reset Content
"206"  ; Section 10.2.7: Partial Content
"300"  ; Section 10.3.1: Multiple Choices
"301"  ; Section 10.3.2: Moved Permanently
"302"  ; Section 10.3.3: Found
"303"  ; Section 10.3.4: See Other
"304"  ; Section 10.3.5: Not Modified
"305"  ; Section 10.3.6: Use Proxy
"307"  ; Section 10.3.8: Temporary Redirect
"400"  ; Section 10.4.1: Bad Request
"401"  ; Section 10.4.2: Unauthorized
"402"  ; Section 10.4.3: Payment Required
"403"  ; Section 10.4.4: Forbidden
"404"  ; Section 10.4.5: Not Found
"405"  ; Section 10.4.6: Method Not Allowed
"406"  ; Section 10.4.7: Not Acceptable
"407"  ; Section 10.4.8: Proxy Authentication Required
"408"  ; Section 10.4.9: Request Time-out
"409"  ; Section 10.4.10: Conflict
"410"  ; Section 10.4.11: Gone
"411"  ; Section 10.4.12: Length Required
"412"  ; Section 10.4.13: Precondition Failed
"413"  ; Section 10.4.14: Request Entity Too Large
"414"  ; Section 10.4.15: Request-URI Too Large
"415"  ; Section 10.4.16: Unsupported Media Type
"416"  ; Section 10.4.17: Requested range not satisfiable
"417"  ; Section 10.4.18: Expectation Failed
"500"  ; Section 10.5.1: Internal Server Error
"501"  ; Section 10.5.2: Not Implemented
"502"  ; Section 10.5.3: Bad Gateway
"503"  ; Section 10.5.4: Service Unavailable
"504"  ; Section 10.5.5: Gateway Time-out
"505"  ; Section 10.5.6: HTTP Version not supported


Source: [1]
Cheers and try hosting at Linode.

No comments:

Post a Comment