DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd December 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default awstats error

I use this link for install can config of awstats

http://www.scriptinstallation.in/fre...s_install.html

and do everything I see in this page but when I type this command I

Code:
./awstats.pl -config=faridi -update
I see this error

Code:
Create/Update database for config "./awstats.faridi.conf" by AWStats version 6.8 (build 1.910)
From data in log file "/var/log/httpd/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /var/log/httpd/access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
127.0.0.1 - - [28/Jun/2008:12:43:37 +0430] "POST /RPC2 HTTP/1.0" 404 307
Setup ('./awstats.faridi.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
this is my awstat conf
Code:
# AWSTATS CONFIGURE FILE 6.8
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
# $Revision: 1.333 $ - $Author: eldy $ - $Date: 2008/02/26 01:33:59 $



#-----------------------------------------------------------------------------
# MAIN SETUP SECTION (Required to make AWStats work)
#-----------------------------------------------------------------------------

# "LogFile" contains the web, ftp or mail 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.%YYYY-0%MM-0%DD-0.log"
# 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 </var/log/apache/access.log.gz |"
# If there are several log files from load balancing servers :
# Example: "/pathtotools/logresolvemerge.pl *.log |"
#
LogFile="/var/log/httpd/access.log"


# Enter the log file type you want to analyze.
# Possible values:
#  W - For a web log file
#  S - For a streaming 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 to know how to configure your web server to
# have the required log format).
# Possible values: 1,2,3,4 or "your_own_personalized_log_format"
# 1 - Apache or Lotus Notes/Domino native combined log format (NCSA combined/XLF/ELF log format)
# 2 - IIS or ISA format (IIS W3C log format). See FAQ-COM115 For ISA.
# 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" = If your log is ftp, mail or other format,
#     you must use following keys to define the log format string (See FAQ for
#     ftp, mail or exotic web log format examples):
#   %host             Client hostname or IP address (or Sender host for mail log)
#   %host_r           Receiver hostname or IP address (for mail log)
#   %lognamequot      Authenticated login/user with format: "john"
#   %logname          Authenticated login/user with format: john
#   %time1            Date and time with format: [dd/mon/yyyy:hh:mm:ss +0000] or [dd/mon/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 or Mon dd hh:mm:ss yyyy
#   %time4            Date and time with unix timestamp format: dddddddddd
#   %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
#   %uabracket        User agent with format: [Mozilla/4.0 (compatible, ...)]
#   %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), use this to define cluster id field.
#   %extraX           Another field that you plan to use for building a
#                     personalized report with ExtraSection feature (See later).
#   If your log format has some fields not included in this list, use:
#   %other            Means another not used field
#   %otherquot        Means another not used double quoted field
#
# Examples for Apache combined logs (following two examples are equivalent):
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
#
# Example for IIS:
# LogFormat = 2
#
LogFormat=1


# 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)
# Backslash can be used as escape character.
# Example: " "
# Example: "\t"
# Example: "\|"
# Example: ","
# Default: " "
#
LogSeparator=" "


# "SiteDomain" must contain the main domain name, or the main intranet web
# server name, used to reach the web site.
# If you share the same log file for several virtual web servers, this
# parameter is used to tell AWStats to filter record that contains records for
# this virtual host name only (So check that this virtual hostname can be
# found in your log file and use a personalized log format that include the
# %virtualname tag).
# But for multi hosting a better solution is to have one log file for each
# virtual web server. In this case, this parameter is only used to generate
# full URL's links when ShowLinksOnUrl option is set to 1.
# If analyzing mail log, enter here the domain name of mail server.
# Example: "myintranetserver"
# Example: "www.domain.com"
# Example: "ftp.domain.com"
# Example: "domain.com"
#
SiteDomain="faridi"


# Enter here all other possible domain names, addresses or virtual host
# aliases someone can use to access your site. Try to keep only the minimum
# number of possible names/addresses to have the best performances.
# You can repeat the "SiteDomain" value in this list.
# This parameter is used to analyze referer field in log file and to help
# AWStats to know if a referer URL is a local URL of same site or an URL of
# another site.
# Note: Use space between each value.
# Note: You can use regular expression values writing value with REGEX[value].
# Note: You can also use @/mypath/myfile if list of aliases are in a file.
# Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
#
HostAliases="localhost 127.0.0.1 192.168.0.20 REGEX[myserver\.com$]"


# If you want to have hosts reported by name instead of ip address, AWStats
# need to make reverse DNS lookups (if not already done in your log file).
# With DNSLookup to 0, all hosts will be reported by their IP addresses and
# not by the full hostname of visitors (except if names are already available
# in log file).
# If you want/need to set DNSLookup to 1, don't forget that this will reduce
# dramatically AWStats update process speed. Do not use on large web sites.
# Note: Reverse DNS lookup is done on IPv4 only (Enable ipv6 plugin for IPv6).
# Note: Result of DNS Lookup can be used to build the Country report. However
# it is highly recommanded to enable the plugin 'geoip' or 'geoipfree' to
# have an accurate Country report with no need of DNS Lookup.
# Possible values:
# 0 - No DNS Lookup
# 1 - DNS Lookup is fully enabled
# 2 - DNS Lookup is made only from static DNS cache file (if it exists)
# Default: 2
# 
DNSLookup=2


# When AWStats updates its statistics, it stores results of its analysis in 
# files (AWStats database). All those files are written in the directory
# defined by the "DirData" parameter. Set this value to the directory where
# you want AWStats to save its database and working files into.
# Warning: If you want to be able to use the "AllowToUpdateStatsFromBrowser"
# feature (see later), you need "Write" permissions by web server user on this
# directory (and "Modify" for Windows NTFS file systems).
# Example: "/var/lib/awstats"
# Example: "../data"
# Example: "C:/awstats_data_dir"
# Default: "."          (means same directory as awstats.pl)
#
DirData="/usr/local/www/awstats/data"


# Relative or absolute web URL of your awstats cgi-bin directory.
# This parameter is used only when AWStats is run from command line
# with -output option (to generate links in HTML reported page).
# Example: "/awstats"
# Default: "/cgi-bin"   (means awstats.pl is in "/yourwwwroot/cgi-bin")
#
DirCgi="/awstats"



# Relative or absolute web URL of your awstats icon directory.
# If you build static reports ("... -output > outputpath/output.html"), enter
# path of icon directory relative to the output directory 'outputpath'.
# Example: "/awstatsicons"
# Example: "../icon"
# Default: "/icon" (means you must copy icon directories in "/mywwwroot/icon")
#
DirIcons="/awstatsicons"


# When this parameter is set to 1, AWStats adds a button on report page to
# allow to "update" statistics from a web browser. Warning, when "update" is
# made from a browser, AWStats is run as a CGI by the web server user defined
# in your web server (user "nobody" by default with Apache, "IUSR_XXX" with
# IIS), so the "DirData" directory and all already existing history files
# awstatsMMYYYY[.xxx].txt must be writable by this user. Change permissions if
# necessary to "Read/Write" (and "Modify" for Windows NTFS file systems).
# Warning: Update process can be long so you might experience "time out"
# browser errors if you don't launch AWStats frequently enough.
# When set to 0, update is only made when AWStats is run from the command
# line interface (or a task scheduler).
# Possible values: 0 or 1
# Default: 0
#
AllowToUpdateStatsFromBrowser=0


# AWStats saves and sorts its database on a month basis (except if using
# databasebreak option from command line). 
# However, if you choose the -month=all from command line or
# value '-Year-' from CGI combo form to have a report for all year, AWStats
# needs to reload all data for full year (each month), and sort them,
# requiring a large amount of time, memory and CPU. This might be a problem
# for web hosting providers that offer AWStats for large sites, on shared
# servers, to non CPU cautious customers.
# For this reason, the 'full year' is only enabled on Command Line by default.
# You can change this by setting this parameter to 0, 1, 2 or 3.
# Possible values:
#  0 - Never allowed
#  1 - Allowed on CLI only, -Year- value in combo is not visible
#  2 - Allowed on CLI only, -Year- value in combo is visible but not allowed
#  3 - Possible on CLI and CGI
# Default: 2
#
AllowFullYearView=2



#

Last edited by mfaridi; 2nd December 2008 at 07:20 AM.
Reply With Quote
  #2   (View Single Post)  
Old 2nd December 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

The answer is already in the error message:

Quote:
AWStats did not find any valid log lines that match your LogFormat parameter
Your log file /var/log/httpd/access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format"
So you wil need to either:
o Change your webserver configuration to use the `combined log format' type of logging.
o Change the awstats LogFormat parameter to whatever your webservers log format is.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 3rd December 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default

I check log format 1 and 2 and 3 and 4 and only 4 work for me and with this log format some kind of option is disable

I put my log format in here
what you think about my log format

Code:
192.168.0.2 - - [03/Dec/2008:11:57:20 +0430] "GET /awstatsicons/other/button.gif HTTP/1.1" 200 147 "http://192.168.0.2/awstats/awstats.pl?config=faridi&framename=mainright" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.18) Gecko/20081116 Firefox/2.0.0.18"
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick