Awstats

From Fxp Wiki

Jump to: navigation, search

httpd.conf Virtual hosts

On doit d'abord observer et paramétrer les virtual hosts dont on a besoin pour Apache. Ici par exemple, deux noms de domaines correspondent à la même adresse IP (au même ordinateur). Il faut donc faire comprendre à Apache qu'il doit répondre aux requêtes de chacun de ces noms de domaines, en redirigeant éventuellement vers des dossiers particuliers ces requêtes.
Ici, il faut rediriger le domaine cib.homedns.org vers le port 8080 de Tomcat.
We must first setup the different virtual hosts needed for Apache. For exemple, here, we have two domain names for the same machine (same IP). We must tell Apache to answer requests for both of them, and eventually, tell to which sub-folder redirect them.

Here we need to redirect the domain cib.homedns.org to the port 8080 or Tomcat.

  1. server configs

ServerName localhost:80 ServerAdmin admin@localhost

NameVirtualHost *

   ServerName localhost
   ServerAdmin webmaster@laposte.net

   ServerName fxp.homedns.org
   ServerAdmin webmaster.fxp@laposte.net

   ServerName cib.homedns.org
   ServerAlias cib.homedns.org/JSPWiki
   ServerAdmin webmaster.cib@laposte.net
   DocumentRoot "C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/JSPWiki"
   ErrorLog logs/cib-errorlog
   CustomLog logs/cib-access.log common

httpd.conf : log

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# You need to enable mod_logio.c to use %I and %O
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio


awstats.cib.conf

  1. -----------------------------------------------------------------------------
  2. MAIN SETUP SECTION (Required to make AWStats work)
  3. -----------------------------------------------------------------------------
  1. "LogFile" contains the web server log file to analyze.
  2. Possible values: A full path, or a relative path from awstats.pl directory.
  3. Example: "/var/log/apache/access.log"
  4. Example: "../logs/mycombinedlog.log"
  5. You can also use tags in this filename if you need a dynamic file name
  6. depending on date or time (Replacement is made by AWStats at the beginning
  7. of its execution). This is available tags :
  8.  %YYYY-n is replaced with 4 digits year we were n hours ago
  9.  %YY-n is replaced with 2 digits year we were n hours ago
  10.  %MM-n is replaced with 2 digits month we were n hours ago
  11.  %MO-n is replaced with 3 letters month we were n hours ago
  12.  %DD-n is replaced with day we were n hours ago
  13.  %HH-n is replaced with hour we were n hours ago
  14.  %NS-n is replaced with number of seconds at 00:00 since 1970
  15.  %WM-n is replaced with the week number in month (1-5)
  16.  %Wm-n is replaced with the week number in month (0-4)
  17.  %WY-n is replaced with the week number in year (01-52)
  18.  %Wy-n is replaced with the week number in year (00-51)
  19.  %DW-n is replaced with the day number in week (1-7, 1=sunday)
  20. use n=24 if you need (1-7, 1=monday)
  21.  %Dw-n is replaced with the day number in week (0-6, 0=sunday)
  22. use n=24 if you need (0-6, 0=monday)
  23. Use 0 for n if you need current year, month, day, hour...
  24. Example: "/var/log/access_log.%Y[[Image:Cib
  25. Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
  26. You can also use a pipe if log file come from a pipe.
  27. Example: "gzip -d

LogFile="c:\Apache2\logs\cib-access.log"

# Enter the log file type you want to analyze.
# Possible values:
#  W - For a web log file
#  M - For a mail log file
#  F - For a ftp log file
# Example: W
# Default: W
#

LogType=W

  1. Enter here your log format (Must match your web server config. See setup
  2. instructions in documentation know how to configure your web server to have
  3. the required log format).
  4. Possible values: 1,2,3,4,5 or "your_own_personalized_log_format"
  5. 1 - Apache or Lotus Notes/Domino native combined log format (NCSA combined/XLF/ELF log format)
  6. 2 - IIS log format (W3C log format)
  7. 3 - Webstar native log format
  8. 4 - Apache or Squid native common log format (NCSA common/CLF log format)
  9. With LogFormat=4, some features (browsers, os, keywords...) can't work.
  10. "your_own_personalized_log_format" = To use AWStats with any not If your log is a personalized format,
  11. you must use the following syntax keys to define the log format string:
  12.  %host Host client name or IP address
  13.  %lognamequot Authenticated login/user with format: "alex"
  14.  %logname Authenticated login/user with format: alex
  15.  %time1 Date and time with format: [dd/mmm/yyyy:hh:mm:ss +0000] or [dd/mmm/yyyy:hh:mm:ss]
  16.  %time2 Date and time with format: yyyy-mm-dd hh:mm:ss
  17.  %time3 Date and time with format: Mon dd hh:mm:ss
  18.  %methodurl Method and URL with format: "GET /index.html HTTP/x.x"
  19.  %methodurlnoprot Method and URL with format: "GET /index.html"
  20.  %method Method with format: GET
  21.  %url URL only with format: /index.html
  22.  %query Query string (used by URLWithQuery option)
  23.  %code Return code status (with format for web log: 999)
  24.  %bytesd Size of document in bytes
  25.  %refererquot Referer page with format: "http://from.com/from.htm"
  26.  %referer Referer page with format: http://from.com/from.htm
  27.  %uaquot User agent with format: "Mozilla/4.0 (compatible, ...)"
  28.  %ua User agent with format: Mozilla/4.0_(compatible...)
  29.  %gzipin mod_gzip compression input bytes: In:XXX
  30.  %gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct.
  31.  %gzipratio mod_gzip compression ratio: ZZpct.
  32.  %deflateratio mod_deflate compression ratio with format: (ZZ)
  33.  %email EMail sender (for mail log)
  34.  %email_r EMail receiver (for mail log)
  35.  %virtualname Web sever virtual hostname. Use this tag when same log
  36. contains data of several virtual web servers. AWStats
  37. will discard records not in SiteDomain nor HostAliases
  38.  %cluster If log file is provided from several computers (merged by
  39. logresolvemerge.pl), this tag define field of cluster id.
  40. If your log format has some fields not included in this list, use:
  41.  %other Means another field not used
  42. Examples for Apache combined logs (following two examples are equivalent):
  43. LogFormat = 1
  44. LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
  45. Examples for IIS (following two examples are equivalent):
  46. LogFormat = 2
  47. LogFormat = "%time2 %host %logname %method %url %code %bytesd %other %ua %referer"

LogFormat = 4

  1. If your log field's separator is not a space, you can change this parameter.
  2. This parameter is not used if LogFormat is a predefined value (1,2,3,4,5,6)
  3. Example: " "
  4. Example: "\t"
  5. Example: "|"
  6. Default: " "

LogSeparator=" "
SiteDomain="cib.homedns.org"
HostAliases="cib.homedns.org cib.homedns.org:8080"
DNSLookup=2



LogSerie
Personal tools