Awstats
From Fxp Wiki
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.
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.
- 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
- -----------------------------------------------------------------------------
- MAIN SETUP SECTION (Required to make AWStats work)
- -----------------------------------------------------------------------------
- "LogFile" contains the web server log file to analyze.
- Possible values: A full path, or a relative path from awstats.pl directory.
- Example: "/var/log/apache/access.log"
- Example: "../logs/mycombinedlog.log"
- You can also use tags in this filename if you need a dynamic file name
- depending on date or time (Replacement is made by AWStats at the beginning
- of its execution). This is available tags :
- %YYYY-n is replaced with 4 digits year we were n hours ago
- %YY-n is replaced with 2 digits year we were n hours ago
- %MM-n is replaced with 2 digits month we were n hours ago
- %MO-n is replaced with 3 letters month we were n hours ago
- %DD-n is replaced with day we were n hours ago
- %HH-n is replaced with hour we were n hours ago
- %NS-n is replaced with number of seconds at 00:00 since 1970
- %WM-n is replaced with the week number in month (1-5)
- %Wm-n is replaced with the week number in month (0-4)
- %WY-n is replaced with the week number in year (01-52)
- %Wy-n is replaced with the week number in year (00-51)
- %DW-n is replaced with the day number in week (1-7, 1=sunday)
- use n=24 if you need (1-7, 1=monday)
- %Dw-n is replaced with the day number in week (0-6, 0=sunday)
- use n=24 if you need (0-6, 0=monday)
- Use 0 for n if you need current year, month, day, hour...
- Example: "/var/log/access_log.%Y[[Image:Cib
- Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
- You can also use a pipe if log file come from a pipe.
- 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
- Enter here your log format (Must match your web server config. See setup
- instructions in documentation know how to configure your web server to have
- the required log format).
- Possible values: 1,2,3,4,5 or "your_own_personalized_log_format"
- 1 - Apache or Lotus Notes/Domino native combined log format (NCSA combined/XLF/ELF log format)
- 2 - IIS log format (W3C log format)
- 3 - Webstar native log format
- 4 - Apache or Squid native common log format (NCSA common/CLF log format)
- With LogFormat=4, some features (browsers, os, keywords...) can't work.
- "your_own_personalized_log_format" = To use AWStats with any not If your log is a personalized format,
- you must use the following syntax keys to define the log format string:
- %host Host client name or IP address
- %lognamequot Authenticated login/user with format: "alex"
- %logname Authenticated login/user with format: alex
- %time1 Date and time with format: [dd/mmm/yyyy:hh:mm:ss +0000] or [dd/mmm/yyyy:hh:mm:ss]
- %time2 Date and time with format: yyyy-mm-dd hh:mm:ss
- %time3 Date and time with format: Mon dd hh:mm:ss
- %methodurl Method and URL with format: "GET /index.html HTTP/x.x"
- %methodurlnoprot Method and URL with format: "GET /index.html"
- %method Method with format: GET
- %url URL only with format: /index.html
- %query Query string (used by URLWithQuery option)
- %code Return code status (with format for web log: 999)
- %bytesd Size of document in bytes
- %refererquot Referer page with format: "http://from.com/from.htm"
- %referer Referer page with format: http://from.com/from.htm
- %uaquot User agent with format: "Mozilla/4.0 (compatible, ...)"
- %ua User agent with format: Mozilla/4.0_(compatible...)
- %gzipin mod_gzip compression input bytes: In:XXX
- %gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct.
- %gzipratio mod_gzip compression ratio: ZZpct.
- %deflateratio mod_deflate compression ratio with format: (ZZ)
- %email EMail sender (for mail log)
- %email_r EMail receiver (for mail log)
- %virtualname Web sever virtual hostname. Use this tag when same log
- contains data of several virtual web servers. AWStats
- will discard records not in SiteDomain nor HostAliases
- %cluster If log file is provided from several computers (merged by
- logresolvemerge.pl), this tag define field of cluster id.
- If your log format has some fields not included in this list, use:
- %other Means another field not used
- Examples for Apache combined logs (following two examples are equivalent):
- LogFormat = 1
- LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
- Examples for IIS (following two examples are equivalent):
- LogFormat = 2
- LogFormat = "%time2 %host %logname %method %url %code %bytesd %other %ua %referer"
LogFormat = 4
- If your log field's separator is not a space, you can change this parameter.
- This parameter is not used if LogFormat is a predefined value (1,2,3,4,5,6)
- Example: " "
- Example: "\t"
- Example: "|"
- Default: " "
LogSeparator=" " SiteDomain="cib.homedns.org" HostAliases="cib.homedns.org cib.homedns.org:8080" DNSLookup=2
Categories: Softwares | Apache | Wikis
