Mollien dot Net is IPv6 Enabled!


   My About.Me page
   View my profile on LinkedIn
   Follow me on Twitter
    View my Facebook profile   View my Hyves profile   View my YouTube favorites and uploads

      01010011
      01100101
      01110010
      01101001
      01101111
      01110101
      01110011
      01000111
      01100101
      01100101
      01101011

IPv6 Certification Badge for Cas Mollien
 


 
HTTP Response Codes and Common Log Format
 
A brief explanation of response codes like 404, 201 and 501 and how the standard 'Common Log Format' should be read.
 
By: Cas Mollien
Last modified on:




 
The Significance of the First Digit in the HTTP Response Code
1xxInformational. The HTTP 1.0 specification does not use informational response codes. Therefore, there are no 1xx series response codes.
2xxSuccess. The command was received, understood, and accepted.
3xxRedirection. Further action is required to complete the request.
4xxClient Error. The request contains bad syntax or otherwise cannot be fulfilled.
5xxServer Error. The server failed to fulfill an apparently valid request.


The List of HTTP Response Codes

200 OK.
201 Created.
202 Accepted.
204 No content.
301 Moved permanently.
302 Moved temporarily.
304 Not modified.
400 Bad request.
401 Unauthorized.
403 Forbidden.
404 Not found.
500 Internal server error.
501 Not implemented.
502 Bad gateway.
503 Service unavailable.

What is a Common Log Format file?
A common log format file is created by the web server to keep track of the requests that occur on a web site. A few lines of a typical log file are shown below:


bacuslab.pr.mcs.net - - [01/Jan/1997:12:57:45 -0600] "GET /~bacuslab/ HTTP/1.0" 304 0
bacuslab.pr.mcs.net - - [01/Jan/1997:12:57:49 -0600] "GET /~bacuslab/BLI_Logo.jpg HTTP/1.0" 200 8210
bacuslab.pr.mcs.net - - [01/Jan/1997:12:57:49 -0600] "GET /~bacuslab/BulletA.gif HTTP/1.0" 304 0
bacuslab.pr.mcs.net - - [01/Jan/1997:12:57:50 -0600] "GET /~bacuslab/Email4.gif HTTP/1.0" 304 0
bacuslab.pr.mcs.net - - [01/Jan/1997:12:57:50 -0600] "GET /~bacuslab/HomeCount.xbm HTTP/1.0" 200 890
151.99.190.27 - - [01/Jan/1997:13:06:51 -0600] "GET /~bacuslab HTTP/1.0" 301 -4
151.99.190.27 - - [01/Jan/1997:13:06:52 -0600] "GET /~bacuslab/ HTTP/1.0" 200 1779
151.99.190.27 - - [01/Jan/1997:13:06:54 -0600] "GET /~bacuslab/BLI_Logo.jpg HTTP/1.0" 200 8210
151.99.190.27 - - [01/Jan/1997:13:06:54 -0600] "GET /~bacuslab/BulletA.gif HTTP/1.0" 200 1151
151.99.190.27 - - [01/Jan/1997:13:06:54 -0600] "GET /~bacuslab/Email4.gif HTTP/1.0" 200 3218
151.99.190.27 - - [01/Jan/1997:13:06:54 -0600] "GET /~bacuslab/HomeCount.xbm HTTP/1.0" 200 890
151.99.190.27 - - [01/Jan/1997:13:07:21 -0600] "GET /~bacuslab/celsheet.html HTTP/1.0" 200 13276
151.99.190.27 - - [01/Jan/1997:13:07:25 -0600] "GET /~bacuslab/CellSheet.xbm HTTP/1.0" 200 356
151.99.190.27 - - [01/Jan/1997:13:07:38 -0600] "GET /~bacuslab/celsort1.gif HTTP/1.0" 200 24576
151.99.190.27 - - [01/Jan/1997:13:07:38 -0600] "GET /~bacuslab/cvscreen.gif HTTP/1.0" 200 24576
151.99.190.27 - - [01/Jan/1997:13:07:38 -0600] "GET /~bacuslab/celsort2.gif HTTP/1.0" 200 32768
151.99.190.27 - - [01/Jan/1997:13:07:38 -0600] "GET /~bacuslab/csfull20.gif HTTP/1.0" 200 40960



The format of the common log file line has the following fields separated by a space:



remotehost | rfc931 | authuser | [date] | "request" | status | bytes


For example:
remotehost: 151.99.190.27
rfc931: -
authuser: -
[date]: [01/Jan/1997:13:07:21 -0600]
"request": "GET /~bacuslab/celsheet.html HTTP/1.0"
status: 200
bytes: 13276



remotehost
Remote hostname. (or IP address number if DNS hostname is not available or was not provided)


rfc931
The remote login name of the user. (If not available a minus sign is typically placed in the field)


authuser
The username as which the user has authenticated himself. This is available when using password protected WWW pages. (If not available a minus sign is typically placed in the field)


[date]
Date and time of the request.


"request"
The request line exactly as it came from the client. (i.e., the file name, and the method used to retrieve it [typically GET])


status
The HTTP response code returned to the client. Indicates whether or not the file was successfully retrieved, and if not, what error message was returned.


bytes
The number of bytes transferred.




--------------------------------------------------------------------------------

What is an Extended Common Log Format file?
An extended common log format file is a variant of the common log format file simply adding two additional fields to the end of the line, the referer and the user agent fields. A typical line is shown below:


bacuslab.pr.mcs.net - jvb [01/Jan/1997:12:57:45 -0600] "GET /~bacuslab/ HTTP/1.0" 304 0 "http://www.mcs.net/" "Mozilla/2.0GoldB1 (Win95; I)"



The format of the extended common log file line has the following fields separated by a space:


remotehost rfc931 authuser [date] "request" status bytes "referer" "user_agent"
bacuslab.pr.mcs.net
- jvb [01/Jan/1997:12:57:45 -0600] "GET /~bacuslab/ HTTP/1.0" 304 0 "http://www.mcs.net/" "Mozilla/2.0GoldB1 (Win95; I)"

For the above example:
remotehost: bacuslab.pr.mcs.net
rfc931: -
authuser: jvb
[date]: [01/Jan/1997:12:57:45 -0600]
"request": "GET /~bacuslab/ HTTP/1.0"
status: 304
bytes: 0
"referer": "http://www.mcs.net/"
"user_agent": "Mozilla/2.0GoldB1 (Win95; I)"





remotehost

Remote hostname. (or IP address number if DNS hostname is not available or was not provided)


rfc931
The remote login name of the user. (If not available a minus sign is typically placed in the field)

authuser
The username as which the user has authenticated himself. This is available when using password protected WWW pages. (If not available a minus sign is typically placed in the field)

[date]
Date and time of the request.

"request"
The request line exactly as it came from the client. (i.e., the file name, and the method used to retrieve it [typically GET])

status
The HTTP response code returned to the client. Indicates whether or not the file was successfully retrieved, and if not, what error message was returned.

bytes
The number of bytes transferred.

"referer"
The url the client was on before requesting your url. (If it could not be determined a minus sign will be placed in this field)

"user_agent"
The software the client claims to be using. (If it could not be determined a minus sign will be placed in this field)




Thanks to Bacus Laboratories, Inc.
 


Found this article useful? Please consider buying me a beer - or something else useful..
blog comments powered by Disqus
 

 
Terug naar Mollien Dot Net

Terug naar Mollien Dot Net

Terug naar Mollien Dot Net
Total Hits: 1
Unique Visitors: 1
Page Impressions : 1
Remote address: 54.81.210.99