home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / SREFLOGS.DOC < prev    next >
Text File  |  2001-03-27  |  17KB  |  403 lines

  1. 22 November 1999 
  2.                    Configuring the SRE-http Common-Log Audit File
  3.  
  4. A) Introduction
  5.  
  6. In keeping with http server standards, SRE-http will maintain a
  7. common-log format audit file.
  8.  
  9. Besides offering a compact synopsis, a number of tools exist to help you
  10. analyze common-log files. Furthermore, as an adjunct to the common-log audit
  11. file, SRE-http can also record the browser used by each request (as
  12. well as the referer) in seperate log files.
  13.  
  14. This document discusses how to modify the SREFLOGS.INI file.  SREFLOGS.INI
  15. (which should be in the CFGS\ subdirectory of your GoServe working directory)
  16. contains the configuration options for these three log files. These
  17. options include the host-specific (and port-specfic)  filenames for
  18. these log files, audit-suppression instructions, and a few display options.
  19.  
  20. At this moment, there is no SRE-http configurator for SREFLOGS.INI --
  21. you'll have to use your favorite text editor.  Also note that, as
  22. with most other SRE-http configuration files, you can change it
  23. on the fly (SRE-http checks SREFLOGS.INI about every 20 seconds).
  24.  
  25. SREFLOGS.INI can be also be used to run programs on a scheduled basis.
  26. However, we now recommend use of the "scheduling daemon" (as described 
  27. in SCHEDULE.DOC) to specify scheduled events.
  28.  
  29.  
  30. -------------------------------------------------
  31. B) Basic configuration
  32.  
  33. A few basic points:
  34.   i) If you want to record information to these audit files, you need to
  35.      enable the WRITE_LOGS parameter (you can use the configurator to do this).
  36.  
  37.  ii) If you are running a single-host server on port 80, and you
  38.      are happy to record all requests in a standard fashion, then you can
  39.      use the default version of SREFLOGS.INI.
  40.  
  41.      If you choose to do this, several files in the DATA\ directory
  42.      of the GoServe "working directory" (say, D:\GOSERVE\DATA)
  43.      will be created (and written to):
  44.         * COMMON.LOG -- the common-log audit file
  45.         * BROWSERS.LOG -- list of browsers
  46.         * REFERER.LOG -- list of referers
  47.         * COMBINED.LOG -- combination of common, referer, and browser logs.
  48.  
  49. iii) If post-filter processing has been suppressed (say, with the SEL-specific
  50.      NO_POSTFILTER permission), the request will not be recorded to these
  51.      audit files.
  52.  
  53.  iv) Advanced options: 
  54.  
  55.      * You can instruct SRE-http to rename log files when they become
  56.        too large; thereby resetting the size of the log file to 0 bytes.
  57.        To do this, you should set the LOGFILE_MAXSIZE parameter in
  58.        SREFMON.CMD (see INITFILT.DOC for more details on LOGFILE_MAXSIZE).
  59.  
  60.      *  SRE-http will "lazy write" the audit files (about
  61.         once a minute).  SRE-http will also warn you (via the PMPRINTF
  62.         window) when a log file gets large (greater then 1M).  You can  
  63.         change these limits by editing the POSTFCHK.RXX file.
  64.  
  65.      *  SRE-http will add the host-nickname to common log file entries. You 
  66.         can suppress (or enhance) this feature by modiffying the ADD_HOSTNICKNAMES
  67.         parameter in POSTFCHK.RXX.
  68.  
  69. -------------------------------------------------
  70. C) Configuration options
  71.  
  72. Configuration is accomplished by setting variables in SREFLOGS.INI.
  73. The following lists the variables, with details below:
  74.  
  75. COMMONLOG           == Default common-log file
  76. COMMONLOG.nnn       == Common-log file for port nnn server.
  77. COMMONLOG.hostn     == Common-log file for the "hostn" host.
  78. COMMONLOG.hostn.nnn == Common-log file for the "hostn" host on port nnn.
  79.  
  80. BROWSERLOG           == Default browser log file
  81. BROWSERLOG.nnn       == Browser log file for port nnn server.
  82. BROWSERLOG.hostn     == Browser log file for the "hostn" host.
  83. BROWSERLOG.hostn.nnn == Browser log file for the "hostn" host on port nnn.
  84.  
  85. REFERERLOG           == Default referer log file
  86. REFERERLOG.nnn       == Referer log file for port nnn server.
  87. REFERERLOG.hostn     == Referer log file for the "hostn" host.
  88. REFERERLOG.hostn.nnn == Referer log file for the "hostn" host on port nnn.
  89.  
  90. COMBINEDLOG           == Default combined (common/referer/browser) log file
  91. COMBINEDLOG.nnn       == Cominbedlog file for port nnn server.
  92. COMBINEDLOG.hostn     == Combined log file for the "hostn" host.
  93. COMBINEDLOG.hostn.nnn == Combined log file for the "hostn" host on port nnn.
  94.  
  95.  
  96.  
  97. APACHE_MODE          == Select format for Browser and Referer logs 
  98.  
  99.  
  100. FORCE_REFERER        == Use a " - " when no referer request header is available
  101.  
  102. NOOPTIONS            == Do not record the portion of the request selector
  103.                         following the ?
  104.  
  105. NOHTTP               == Do not record the HTTP/1.0 portion of the request
  106.                         string
  107.  
  108. NOCODES              == List of "return codes" and "http methods" to not record.
  109.  
  110. NOUSER               == List of IP addresses, and SRE-http "usernames", to
  111.                         not record
  112.  
  113. NOREFERER           == List of IP addresses to not record in REFERER.LOG
  114.                        (COMMON, COMBINED and BROWSER logs do NOT pay attention to
  115.                         this parameter).
  116.  
  117. NOURL              == Rquest selectors to not record
  118.  
  119. SCHED              == Scheduled programs to run
  120.  
  121.  
  122. C.1) Configuration Details: COMMONGLOG, COMBINEDLOG, BROWSERLOG and REFERERLOG ----
  123.  
  124. The COMMONLOG, COMBINEDLOG, BROWSERLOG, and REFERERLOG "stem" variables all have the same
  125. structure. The basic notion is that SRE-http will take the server port, and
  126. the server's host nickname, and attempt to find matching COMMONLOG (and
  127. COMBINEDLOG, BROWSERLOG and REFERERLOG) variables.  If a match is not found, 
  128. the "default" variables are used.
  129.  
  130. You should set these stem variable to equal filenames. If you use a
  131. relative file name (i.e.; FOO.BAR or DIR1/FOO.BAR), the file is
  132. assumed to be relative to the DATA\ subdirectory of the GoServe
  133. working directory.
  134.  
  135. Note that SREFLOGS.INI prior to SRE-http ver 1.3d, SREFLOGS.INI was in
  136. the DATA\ subdirectory; as of 1.3d, SREFLOGS.INI is in the CFGS\
  137. subdirectory.
  138.  
  139. Some examples should help.  These examples use COMMONLOG,
  140. but the logic is exactly the same for COMBINEDLOG, BROWSERLOG and REFERERLOG.
  141.  
  142. For these examples, assume the following entries in SREFLOGS.INI
  143. (also assume that the DATA\ subdirectory is D:\GOSERVE\DATA)
  144.  COMMONLOG='COMMON.LOG'
  145.  COMMONLOG.CIRCUS.8080='CIRCUS\COMMON.8080'
  146.  COMMONLOG.ZOO='D:\CIRCUS\WWW\COMMON.LOG'
  147.  
  148. Example 1: if the server is a single host (no host nicknames specified)
  149. on the standard port (80), then SRE-http would look for:
  150.    COMMONLOG.80         -- this is the first variable looked for
  151.    COMMONLOG            -- the default
  152. Since COMMONLOG.80 was not specified, COMMONLOG is used (which yields a
  153. value of D:\GOSERVE\DATA\COMMON.LOG).
  154. Note that this example also applies to non-standard ports on single
  155. host systems (with the .80 changed appropriately).
  156.  
  157. Example 2: port 80, host nickname of ZOO:
  158.    COMMONLOG.ZOO.80    -- this is the first variable looked for
  159.    COMMONLOG.ZOO       -- this is the second variable looked for
  160.    COMMONLOG           -- this is the default
  161. COMMONLOG.ZOO.80  was not specified, but COMMONLOG.ZOO was. Thus,
  162. the value will be D:\CIRCUS\WWW\COMMON.LOG.
  163.  
  164. Example 3: port 8080, "host nickname" of CIRCUS:
  165.    COMMONLOG.CIRCUS.8080   -- this is the first variable looked for
  166.    COMMONLOG.CIRCUS        -- this is the second variable looked for
  167.    COMMONLOG               -- this is the default
  168. Since COMMONLOG.CIRCUS.8080 exists; so the value will be
  169. D:\GOSERVE\DATA\CIRCUS\COMMON.8080  (D: must be an HPFS drive).
  170.  
  171. If the desired default is to not record, set COMMONLOG=0.  Note that
  172. you can override this default on a host-nickname/port specific basis.
  173.  
  174. As stated above, the COMBINEDLOG, BROWSERLOG and REFERERLOG variables are 
  175. treated the same way. Thus, to suppress the REFERERLOG, set REFERERLOG=0 
  176. (and have no other REFERERLOG. variables).
  177.  
  178. C.2a) The NOxxx,and other options  --------------------------------------
  179.  
  180. The followings options allow you to modify the output to the common-log file,
  181. and to suppress the recording of selected requests.
  182.  
  183.  
  184. APACHE_MODE:
  185.  
  186.    If APACHE_MODE=1, then the referer and browser log's are written using
  187.    an "Apache" mode (that is, something similar to what Apache server's write).
  188.    If APACHE_MODE=0, then a "GoHTTP" mode is used.
  189.  
  190.    For example:
  191.    APACHE_MODE (browser and referer logs):
  192.      [14/Mar/1996:17:45:08] Mozilla/2.0 (X11; I; HP-UX A.09.05 9000/735)
  193.      [14/Mar/1996:17:48:10] http://guide-p.infoseek.com/Titles -> /~sret1/analog/
  194.    GoHTTP:
  195.      [03/Jun/1997:19:35:16 -0500] DAL40-29.PPP.IADFW.NET Mozilla/2.02E (OS/2; I)
  196.      [2/Mar/1997:18:23:37 -0500] "/imgs/srefiltr.gif" http://ship.float.net/
  197.  
  198.  
  199. FORCE_REFERER:
  200.  
  201.    If FORCE_REFERER=1, then in cases where there is no referer, a " - " 
  202.    is used.
  203.  
  204.  
  205. NOOPTIONS:
  206.    If NOOPTIONS=1, then the portion of the request selector following a ?
  207.    will not be included.  Since this can be quite long (as when you are
  208.    using the GET method in an HTML FORM), inclusion of this information can
  209.    lead to very long (and hard to read) entries.
  210.    For example: given a request for: /LOOK1?arg1=sub1/&arg2=1&argx=1&xmac=0
  211.                if NOOPTIONS=1, the "request" portion of the common-log (and
  212.                referers log) will be /LOOK1
  213.  
  214. NOHTTP
  215.    Technically, a request string should end with the HTTP version.
  216.    Since this is almost always HTTP/1.0, and since it's not clear that
  217.    the common-log format requires this information, you can suppress this
  218.    portion of the request string by setting NOHTTP=1.
  219.  
  220. NOCODES
  221.    NOCODES should contain a space delimited list of  3 digit
  222.    "return status codes", and http-methods, that you do NOT want 
  223.    to record. For example,
  224.    you may not be interested in requests that generated a "authorization
  225.    response" (a 401 response). If so, set:
  226.        NOCODES='401 '
  227.    If you are also uninterested in "moved" responses, you can set:
  228.        NOCODES='401 301 302 '
  229.    If you are not interested in "authorization responses" and responses
  230.    to HEAD method requests:
  231.        NOCODES='401 HEAD'
  232.    And if you are sort of perverse, and are not interested in normal
  233.    responses, you can set:
  234.        NOCODES='200 '
  235.  
  236.    If the response code, or the request method, matches one of these NOCODES,
  237.    then none of the log files are written to.
  238.  
  239.  
  240. NOUSER
  241.    This should contain a space delimited list of IP names (or numeric
  242.    addresses for those clients with no IP name) that you do NOT wish to record.
  243.    It can also contain "usernames" (from SRE-http's USERS.IN
  244.    usename/password database).
  245.    That is, requests from these addresses (and from these "users") will NOT be
  246.    recorded.  One sensible use of this is to include OWNER's IP address
  247.    (since you probably don't care about requests you make to yourself), as
  248.    well as the "usernames" of the various SUPERUSERs.
  249.    Note that if you take this suggestion, you must put in the OWNER's IP
  250.    name (in contrast, the SRE-http OWNERS variable expects a numeric
  251.    IP address).
  252.  
  253.    Example: NOUSER=' joe.bars.net *.wah.com 151.121.55.6  ADMINX '
  254.  
  255.    Notes:
  256.      * you can use * as a wildcard for a field. Thus, ab.wah.com
  257.        and cd.wah.com would both match *.wah.com, but www.ef.wah.com would
  258.        NOT.
  259.     * If 151.121.55.6 has an IP name of jill.money.gov,
  260.       she would NOT match 151.121.55.6 -- 151.121.55.6 would only match
  261.       if there was NO ip name available.
  262.     * ADMINX is a possible "username" (possibly of a SUPERUSER).
  263.     * If a match to any of these NOCODES occurs, then none of the log files
  264.       are written to.
  265.  
  266. NOREFERER
  267.    This should contain a space delimited list of IP names (or numeric
  268.    addresses for those clients with no IP name) that you do NOT wish to record
  269.    in the REFERER.LOG file.
  270.    That is, requests that were refered from these addresses will NOT be
  271.    recorded in REFERER.LOG.  However, these requests WILL be recorded in the 
  272.    common.log, combined.log, and browser.log files.
  273.  
  274.  
  275.    Example: NOREFERER=' *.my.site.net  backup.site.org '
  276.  
  277.    Notes:
  278.      * you can use * as a wildcard for a field. Thus, ab.wah.com
  279.        and cd.wah.com would both match *.wah.com, but www.ef.wah.com would
  280.        NOT.
  281.     * If 151.121.55.6 has an IP name of jill.money.gov,
  282.       she would NOT match 151.121.55.6 -- 151.121.55.6 would only match
  283.       if there was NO ip name available.
  284.  
  285.  
  286. NOURL
  287.    The NOURL entries should contain URLs to NOT record. That is, if a request
  288.    selector matches one of these URLs, it will NOT be recorded.
  289.    For example:
  290.         NOURL = 'IMGS/*
  291.         NOURL = 'BORING/TEDIOUS.HTM '
  292.  
  293.    Notes:
  294.     *  You can include * as a wildcard. Thus, IMGS/HORSE.GIF
  295.        matches NOURL, and such requests would NOT be recorded
  296.        the common-log, etc. audit files.
  297.     *  These entries are NOT sensitive to host or port -- all
  298.        NOURL entries will apply to all hosts and ports (perhaps
  299.        we'll fix this up if there's enough demand).
  300.     *  If a request selector matches one of these NOURL variables, then none
  301.        of the log files are written to.
  302.     *  The several SRE-http hit suppresion options (such as
  303.        HIT_OWNER_SUPPRESS, have NO effect on these audit files).
  304.     *  \ are converted to /, and leading / are stripped.
  305.  
  306.     * You can also use the older (prior to sre-htt ver 1.3b.1298c) of:
  307.       NOURL.1 ='xxx'
  308.       NOURL.2='yyyy'
  309.       NOURL.3=0
  310.  
  311.  
  312. SCHED
  313.    SCHED='frequency prog_name argument' entries can be included
  314.    in SREFLOGS.INI. However, this has been deprecated -- the use
  315.    of SCHEDULE.CFG is recommened instead (see SCHEDULE.DOC for the details).
  316.  
  317. -------------------------------------------------
  318. D) Structure of .LOG files
  319.  
  320.  
  321. i) The common-log file format -------------------
  322.  
  323. (the following description is adapted from
  324.   http://www.apache.org/docs/mod/mod_log_common.html)
  325.  
  326. The common-log file contains a separate line for each request.
  327. A line is composed of several items (tokens) separated by spaces:
  328.      host ident authuser date request status bytes
  329. If a token does not have a value then it is represented by a hyphen (-).
  330.  
  331. The meanings and values of these tokens are as follows:
  332.  
  333. client
  334.   The fully-qualified domain name of the client, or its IP number if the
  335.   name is not available.
  336. ident
  337.    The identd identity information: NOT SUPPORTED BY SRE-http.
  338. authuser
  339.    The client's username, as provided in the AUTHORIZATION request header.
  340.    Note that the common-log standard suggests that "if the request was for a
  341.    password protected document, then this is the userid used in the request".
  342.    However, SRE-http will always include the authuser (if available), even
  343.    if the particular request did not require authorization.
  344. date
  345.    The date and time of the request, in the following format:
  346.       date = [day/month/year:hour:minute:second zone]
  347.    where:
  348.          day = 2 digit
  349.          month = 3 letter
  350.          year = 4 digit
  351.          hour = 2 digit
  352.          minute = 2 digit
  353.          second = 2 digit
  354.          zone = (`+' | `-') 4 digit
  355. request
  356.      The request line from the client, enclosed in double quotes
  357. status
  358.    The three digit status code returned to the client.
  359. bytes
  360.    The number of bytes in the object returned to the client, not including
  361.    any headers.
  362.  
  363. For example:
  364.  acl.wear.org - - [18/Mar/1996:16:24:08 -0500] "GET /SMP/HLO.HTM HTTP/1.0" 200 1251
  365.  
  366. In the above example, the HTTP/1.0 substring may not be standard (you can
  367. suppress it by setting the NOHTTP option in SREFLOGS.INI). Also note that
  368. -0500 corresponds to the EST offset from GMT.
  369.  
  370. ii) The BROWSERS log file ---------------------
  371.  
  372. The browsers log file has the following structure:
  373.    [date] client : user-agent
  374. For example:
  375.   [24/Feb/1997:18:14:30 -0500] 151.121.65.143 : IBM-WebExplorer-DLL/v1.1b
  376.  
  377. iii) The REFERERS log file ----------------------
  378.  
  379. The referers log file has the following structure:
  380.    [date]  "sel"  referer_url
  381. Where SEL is from the request string, and the referer_url is from the
  382. REFERER request header.
  383. For example:
  384.    [24/Feb/1997:18:18:19 -0500] "/SAMPLES/samp1.htm" http://dh.ag.gov/i.htm
  385. (http://dh.ag.gov/i.htm contained a link to /samples/samp1.htm)
  386.  
  387. Note: if a request does not have a REFERER request header (for example, WebEx
  388. does not provide a REFERER request header):
  389.   if FORCE_REFERER=0, an entry will NOT be added to the   REFERERS log.
  390.      FORCE_REFERER=1, a referer of " - " is used.
  391.  
  392. iv)The COMBINEDLOG log file
  393.  
  394. The  combined log file combines the common, referer, and browser logs.
  395. It has the following structure:
  396.   PARROT.HALL.NET - - [04/Jun/1997:22:38:16 -0400] "GET /imgs/justscal.gif"
  397.   200 516 "http://mysite.heights.edu/SAMPLES/guide.htm"
  398.   "Mozilla/2.02E (OS/2; I)"
  399. (but all on one long line).
  400.  
  401.  
  402. -- End of documentation.
  403.