欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
強大的日志分析工具AWStats
主頁(yè)http://awstats.sourceforge.net
注:此文基本按照官方文檔的操作一步步進(jìn)行,在安裝過(guò)程中參考了相關(guān)的文檔作了必要的改動(dòng).
環(huán)境 :
redhat 9
Apache/2.0.54 源碼安裝,路徑為/usr/local/apache2
主機IP 192.168.0.111域名 s1.domain1.com
所用的版本awstats-6.5.tar.gz
實(shí)現功能:
通過(guò)awstats統計s1.domain1.com的訪(fǎng)問(wèn)信息,并提供web頁(yè)面查看
AWStats的功能很多,具體的可點(diǎn)擊上面的官網(wǎng),我在此主要用它來(lái)分析apache服務(wù)器的日志.使用之前還是說(shuō)說(shuō)大致的原理:awstats提供一系列的perl腳本實(shí)現:服務(wù)配置,日志讀取,報表生成等功能.而功能實(shí)現的具體執行過(guò)程是:首先當然是apache將訪(fǎng)問(wèn)情況記錄到日志中,AWStats每次執行更新時(shí)讀取這些日志,分析日志數據,將結果存儲到數據庫中,(這個(gè)數據庫是awstats自帶的,并不需要第三方軟件支持.),最后AWStats提供一個(gè)cgi程序通過(guò)web頁(yè)面來(lái)顯示數據庫中所統計的數據.
首先看當前apache的配置,vi httpd.conf
<VirtualHost *:80>
ServerAdminyahoon@xxx.com
DocumentRoot /var/www/html/s1
ServerName  s1.domain1.com
ErrorLog logs/s1_web-error_log
TransferLog logs/s1_web-access_log
</VirtualHost>
訪(fǎng)問(wèn)s1.domain1.com的日志記錄到/usr/local/apache2/logs/s1_web-access_log
安裝過(guò)程如下
將軟件包解壓縮為/usr/local/awstats
第一步是為網(wǎng)站生成配置文件,其實(shí)有很多方式,按照官方文檔的說(shuō)明推薦使用腳本,而且這樣也是比較簡(jiǎn)單的一種方式.
轉到 /usr/local/awstats/tools,此目錄下有很多不同功能的perl腳本.執行
[root@server1 tools]# perl awstats_configure.pl
會(huì )進(jìn)入一個(gè)交互式的配置程序,過(guò)程中會(huì )有些問(wèn)題要你回答,當然這些都是可以在以后的配置文件中修改的.我將所有的內容和注解列出如下
----- AWStats awstats_configure 1.0 (build 1.6) (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
Found Web server Apache config file ‘/usr/local/apache2/conf/httpd.conf‘
檢測到了我當前apache的配置文件
-----> Check and complete web server config file ‘/usr/local/apache2/conf/httpd.conf‘
Warning: You Apache config file contains directives to write ‘common‘ log files
This means that some features can‘t work (os, browsers and keywords detection).
Do you want me to setup Apache to write ‘combined‘ log files [y/N] ?y
AWStats推薦使用combined格式的日志,apache默認使用common格式.所以這個(gè)地方提示要不要修改apache的配置文件,將日志格式改為combined,當然回答yes.
Add ‘Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"‘
Add ‘Alias /awstatscss "/usr/local/awstats/wwwroot/css/"‘
Add ‘Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"‘
Add ‘ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"‘
Add ‘<Directory>‘ directive
AWStats directives added to Apache config file.
向apache的配置文件里面增加了上述內容,里面是一些目錄和別名的設置.這部分一般加到了文件的最后面.
-----> 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/N] ? y
是否需要創(chuàng )建一個(gè)新配置文件,選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:
Ø         s1.domain1.com
這個(gè)地方填網(wǎng)站的域名
-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
> 回車(chē)
生成的配置文件存放的路徑,默認是/etc/awstats,我不修改,直接回車(chē).
-----> Create config file ‘/etc/awstats/awstats.s1.domain1.com.conf‘
Config file /etc/awstats/awstats.s1.domain1.com.conf created.
可以看到文件已經(jīng)創(chuàng )建了,路徑為/etc/awstats/awstats.s1.domain1.com.conf‘
-----> Restart Web server with ‘/sbin/service httpd restart‘
Stopping httpd: [  OK  ]
Starting httpd: httpd: Could not determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName
[  OK  ]
由于修改了httpd.conf,所以它會(huì )自動(dòng)重啟apache來(lái)使配置文件生效,但是這里有個(gè)問(wèn)題,因為我的apache并沒(méi)有采用系統自帶的,而是源碼安裝的,也并沒(méi)有加入service,所以此處啟動(dòng)的雖然成功了,但并不是我需要的.很簡(jiǎn)單,等會(huì )把它關(guān)閉,然后開(kāi)啟我自己的.
-----> 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=s1.domain1.com
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...
由于要得到新信息,就必須更新數據庫,也就是說(shuō)重新做讀取日志.分析日志提取里面新增的部分進(jìn)行分析,將更新的數據存入數據庫的過(guò)程.最好就讓它定時(shí)執行.這段話(huà)是提醒你,要實(shí)現這個(gè)功能就需要手動(dòng)把上面粗體的兩行中的任一行寫(xiě)入crontab,讓它定時(shí)執行.其中第一句是更新s1.domain1.com,而第二句是在有多個(gè)站點(diǎn)情況下,將所有的站點(diǎn)都作更新.我在此不做這個(gè)操作.回車(chē).
A SIMPLE config file has been created: /etc/awstats/awstats.s1.domain1.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘s1.domain1.com‘ with command:
> perl awstats.pl -update -config=s1.domain1.com
You can also read your statistics for ‘s1.domain1.com‘ with URL:
Ø      http://localhost/awstats/awstats.pl?config=s1.domain1.com
Press ENTER to finish...
按回車(chē)來(lái)結束安裝.這段話(huà)就寫(xiě)的很清楚,接下來(lái)的工作就是
檢查配置文件
執行perl awstats.pl -update -config=s1.domain1.com來(lái)更新數據庫
通過(guò)http://localhost/awstats/awstats.pl?config=s1.domain1.com來(lái)查看統計的信息
這段腳本執行完,我們的httpd.conf也更新了,下面是它主要改動(dòng)的部分
將CustomLog logs/access_log common改為
CustomLog logs/access_log combined
在文件的最后面增加了
# Directives to allow use of AWStats as a CGI
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>
在修改之前,還是先停掉腳本啟動(dòng)的apache,將正確的apache啟動(dòng)
[root@server1 tools]# service httpd stop
[root@server1 tools]# /usr/local/apache2/bin/apachectl start
訪(fǎng)問(wèn)網(wǎng)站s1.domain1.com正常顯示,這次訪(fǎng)問(wèn)就應該被記錄到了日志里面.
訪(fǎng)問(wèn)http://192.168.0.111t/awstats/awstats.pl?config=s1.domain1.com,提示
Forbidden
You don‘t have permission to access /awstats/awstats.pl on this server
很明白是權限問(wèn)題,到/usr/local下執行chmod -R 777 awstats (應該755就行了,因為我只是測試而已)
檢查配置文件的關(guān)鍵項目
vi /etc/awstats/awstats.s1.domain1.com.conf
檢查并做如下修改
# LogFile="/var/log/httpd/mylog.log"
LogFile="/usr/local/apache2/logs/s1_web-access_log"
指到apche的日志
LogType=W
表示分析的是web日志
LogFormat=1
表示日志格式為combined
SiteDomain="s1.domain1.com"
域名
HostAliases="s1.domain1.comwww.s1.domain1.com 127.0.0.1 localhost"
這個(gè)變量的意思是這個(gè)域的別名.即多個(gè)域名對應同一網(wǎng)站的情況,這句是自動(dòng)生成的.我這里沒(méi)有用到所以就沒(méi)有改.
更新數據庫
cd /usr/local/awstats/wwwroot/cgi-bin
perl awstats.pl -config=s1.domain1.com -update
得到如下錯誤
Error: AWStats database directory defined in config file by ‘DirData‘ parameter (/var/lib/awstats) does not exist or is not writable.
Setup (‘/etc/awstats/awstats.s1.domain1.com.conf‘ file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in ‘docs‘ directory).
同時(shí)訪(fǎng)問(wèn)http://192.168.0.111t/awstats/awstats.pl?config=s1.domain1.com提示
Error: AWStats database directory defined in config file by ‘DirData‘ parameter (/var/lib/awstats) does not exist or is not writable.
Setup (‘/etc/awstats/awstats.s1.domain1.com.conf‘ file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in ‘docs‘ directory).
很明顯是/var/lib/awstats這個(gè)目錄不存在
這里需要說(shuō)明,這個(gè)路徑是由配置文件/etc/awstats/awstats.s1.domain1.com.conf里面的DirData參數決定的,表示存放數據庫的地方.我沒(méi)有修改所以依然是默認值DirData="/var/lib/awstats"
既然提示不存在,現在就來(lái)新建它
cd /var/lib
mkdir awstats
進(jìn)行數據庫更新
[root@server1 cgi-bin]# perl awstats.pl -config=s1.domain1.com -update
信息如下
Update for config "/etc/awstats/awstats.s1.domain1.com.conf"
With data in log file "/usr/local/apache2/logs/s1_web-access_log"...
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: 1處理的總行數(apache的日志是一行代表一個(gè)記錄)
Found 0 dropped records,
Found 1 corrupted records, 發(fā)現了一個(gè)損壞的記錄
Found 0 old records,
Found 0 new qualified records.
查看日志的內容
[root@server1 cgi-bin]# less /usr/local/apache2/logs/s1_web-access_log
192.168.0.28 - - [30/Aug/2007:10:19:59 +0800] "GET / HTTP/1.1" 200 23
訪(fǎng)問(wèn)http://192.168.0.111/awstats/awstats.pl?config=s1.domain1.com查看統計信息
很是奇怪,為什么會(huì )這樣呢?打開(kāi)httpd.conf發(fā)現虛擬主機的部分并沒(méi)有改動(dòng),所以記錄下來(lái)的日志類(lèi)型并沒(méi)有改變,需要單獨設置使用的日志類(lèi)型.
<VirtualHost *:80>
ServerAdminyahoon@xxx.com
DocumentRoot /var/www/html/s1
ServerName s1.domain1.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined1
CustomLog logs/s1_web-access_log combined1
ErrorLog logs/s1_web-error_log
</VirtualHost>
可以看到我這里將這種日志格式命名為combine1,只是名稱(chēng)而已,可以隨便起.修改后重啟apache
將日志清空,然后訪(fǎng)問(wèn)s1.domain1.com,產(chǎn)生日志如下
[root@server1 cgi-bin]# less /usr/local/apache2/logs/s1_web-access_log
192.168.0.28 - - [30/Aug/2007:13:04:05 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
192.168.0.28 - - [30/Aug/2007:13:05:30 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
192.168.0.28 - - [30/Aug/2007:13:05:30 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
192.168.0.28 - - [30/Aug/2007:13:05:30 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
192.168.0.28 - - [30/Aug/2007:13:05:31 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
192.168.0.28 - - [30/Aug/2007:13:05:31 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; TencentTraveler )"
……
再次更新數據庫
[root@server1 cgi-bin]# perl awstats.pl -config=s1.domain1.com -update
Update for config "/etc/awstats/awstats.s1.domain1.com.conf"
With data in log file "/usr/local/apache2/logs/s1_web-access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access to last remembered record has fallen on another record.
So searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 6
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 6 new qualified records.
訪(fǎng)問(wèn)http://192.168.0.111/awstats/awstats.pl?config=s1.domain1.com
最后需要說(shuō)明的是,在文中已經(jīng)多次提到過(guò),要能反應最新信息就必須更新數據庫.也就是說(shuō)你可能已經(jīng)對它進(jìn)行了多次訪(fǎng)問(wèn),但是查看統計頁(yè)面發(fā)現沒(méi)變化.這是因為這些日志還沒(méi)有更新到數據庫.簡(jiǎn)單的方法就是定時(shí)執行.
當然現在寫(xiě)的也只是這個(gè)軟件的基本安裝和使用,它的使用遠不止于這些.尤其其中涉及到了apache日志的相關(guān)知識,例如rotate日志循環(huán),負載均衡的日志合并等等.我也剛接觸,希望大家多提寶貴意見(jiàn).
下面是相關(guān)的網(wǎng)頁(yè)
http://www.chinaunix.net/jh/13/641101.html
http://www.chedong.com/tech/awstats.html
http://www.chedong.com/tech/rotate_merge_log.html
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
如何在 Linux 環(huán)境下部署 AWStats 分析系統來(lái)監控 Web 站點(diǎn)?
awstats安裝使用
[教程]windows下安裝awstats來(lái)分析apache的訪(fǎng)問(wèn)日志
AWStats安裝配置與使用
使用awstats分析Nginx的訪(fǎng)問(wèn)日志
[精彩] 日志分析軟件awstats的安裝使用簡(jiǎn)易指南
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久