歡迎您光臨本站 註冊首頁

awstats分析qmail日誌分析文檔

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

awstats分析qmail日誌分析文檔

1、下載安裝
wget http://prdownloads.sourceforge.net/awstats/awstats-6.1.tgz
2、解壓縮 awstats-6.1.tgz
3、將解壓出來的 awstats-6.1目錄複製到 /usr/local/ 目錄下,並重命名為awstats
4、進到/usr/local/awstats/tools目錄下,執行./configure.pl
將出現以下情況
設定config檔
----- AWStats configure 1.0 (build 1.32) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> /etc/httpd/conf/httpd.conf <-----輸入httpd.conf的絕對路徑,不輸也可以,輸入none跳過

-----> Check and complete web server config file '/etc/httpd/conf/httpd.conf'
AWStats directives already present.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) ?y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> 這裡輸入域名 <-------- 輸入你所要建立的WebSite name

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=wwww.myunix.idv.tw
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...

A SIMPLE config file has been created: /etc/awstats/awstats.wwww.myunix.idv.tw.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'wwww.myunix.idv.tw' with command:
> perl awstats.pl -update -config=wwww.myunix.idv.tw
You can also read your statistics for 'wwww.myunix.idv.tw' with URL:
> http://localhost/awstats/awstats.pl?config=域名

Press ENTER to finish...
按回車退出

5、以上步驟完成後,會在/etc/awstats目錄下建立一檔案- awstats.域名.conf

6、建立 /var/lib/awstats 目錄,並給予 777 之權

7、設定 httpd.conf,檢查在/etc/httpd/conf/httpd.conf中是否有以下設定,如果沒有的話,請自行加入,並重新啟動httpd服務


在httpd.conf最後加入以下內容
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

8、設定/etc/awstats/awstats.域名.conf
LogFile="perl /usr/local/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"  <----指定你mail log file的絕對及log名稱
LogType=M <---- M代表分析類型為mail log files
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
SiteDomain="mail.myunix.idv.tw" <----指定從log檔中過濾符合SiteDomain的記錄
HostAliases="myunix.idv.tw mail.myunix.idv.tw localhost 127.0.0.1" <-----指定哪些Domain或ip address為Local,其餘皆視為External
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForWormsDetection=0
LevelForSearchEnginesDetection=0
LevelForFileTypesDetection=0
ShowMenu=1
ShowMonthStats=HB
ShowDaysOfMonthStats=HB
ShowDaysOfWeekStats=HB
ShowHoursStats=HB
ShowDomainsStats=0
ShowHostsStats=HBL
ShowAuthenticatedUsers=0
ShowRobotsStats=0
ShowEMailSenders=HBML
ShowEMailReceivers=HBML
ShowSessionsStats=0
ShowPagesStats=0
ShowFileTypesStats=0
ShowFileSizesStats=0
ShowBrowsersStats=0
ShowOSStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0
ShowHTTPErrorsStats=0
ShowSMTPErrorsStats=1
修改完之後保存退出

9、執行awstats.pl,記得指定設定檔時,不要輸入設定檔名前面的 awstats. 及 .conf
#/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=域名 –update
如果出現以下信息,就代表執行成功
Update for config "/etc/awstats/awstats.mail.myunix.idv.tw.conf"
With data in log file "perl /usr/local/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 358
Found 0 dropped records,
Found 0 corrupted records,
Found 358 old records,
Found 0 new qualified records.
分享一下,按照這做肯定成功。
《解決方案》

弱弱地問一下,我出的結果怎麼是這樣的啊?
Update for config "/etc/awstats/awstats.192.168.1.87.conf"
With data in log file "perl /usr/local/awstats/tools/maillogconvert.pl standard < /var/log/qmail |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.
網頁上也沒看到日誌
《解決方案》

我的/var/log/qmail目錄下有這三個目錄 qmail-pop3d  qmail-send  qmail-smtpd 不知道是不是和這個有關係?

[火星人 ] awstats分析qmail日誌分析文檔已經有517次圍觀

http://coctec.com/docs/service/show-post-31694.html