全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1995
推到 Plurk!
推到 Facebook!

超強訪客分析 Awstats -- 連 Windows IIS 也不放過

 
jackkcg
站務副站長


發表:891
回覆:1050
積分:848
註冊:2002-03-23

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-12-22 00:20:10 IP:61.64.xxx.xxx 未訂閱
http://www.adj.idv.tw/phpBB2/viewtopic.php?t=638 [技巧]超強訪客分析 Awstats -- 連 Windows IIS 也不放過... 記得之前有介紹過 Awstats For Linux 的安裝過程...今天不小心讓偶發現Windows IIS 下也可以做 Multi-Domain 的訪客分析...真是讓人興奮...因為大家都知道..在Windows平台下的軟體...什麼都嘛要錢...最近有找過一些Windows平台下的 Log Analyze...看一看還是沒有 Awstats 來的強...它真的是照福很多 Windows IIS 平台下的管理者囉... 在開始進行之前...你必需先完成 ActivePerl for IIS 的安裝...如果你還沒完成...請先參考這一篇: 讓 Windows IIS下也能跑跨平台的 Perl 接著 Download Awstats: 前往 Awstats 官方網站 http://awstats.sourceforge.net/ 在這邊以 Awstats-52.zip 為 Sample...你把壓縮檔解開後...可以看到裡面有個Docs的目錄...裡面寫的很清楚... 在這邊做個簡單的過程描述... 安裝過程 With IIS Server: * Step 1-1 Configure IIS to log in "Extended W3C log format" (You can still use your own log format but setup is easier if made like suggested). So, for this, start the IIS Snap-in, select the web site and look at its Properties. Choose W3C Extended Log Format, then Properties, then the Tab Extended Properties and uncheck everything under Extended Properties. Once they are all unchecked, check all following fields: 代碼: date time c-ip cs-username cs-method cs-uri-stem sc-status sc-bytes cs-version cs(User-Agent) cs(Referer) PS: 以上是要建立W3C擴充記錄檔格式...在擴充內容裡面...這幾個要選一樣的...不能多選...要不然在Run的過程中就會有問題...總共有十一個 To be sure the log format change is effective, you must stop IIS, remove all old log files, restart IIS and go to your homepage. This is an example of records you should get then in the new log file: 2000-07-19 14:14:14 62.161.78.73 - GET / 200 1234 HTTP/1.1 Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) http://www.from.com/from.htm * Step 1-2 Copy the contents of the uncompressed cgi-bin folder from your hard drive to your server's cgi-bin directory (this includes awstats.pl, awstats.model.conf, and the lang, lib and plugins sub-directories). * Step 1-3 Move AWStats icon sub-directories and its content into a directory readable by your web server, for example C:\yourwwwroot\icon. PS:上面兩個步驟因為我要做 Windows版的 Multi-Domain...所以我在D槽建個 awstats的目錄...然後把 wwwroot裡面的cgi-bin 跟 icon 都copy在這邊... 在IIS的部份打算建虛擬目錄的方式...在個別IIS Domain的地方建兩個虛擬目錄... cgi-bin icon * Step 1-4 Copy awstats.model.conf file into a new file named awstats.myvirtualhostname.conf. This new file must be stored in - same directory than awstats.pl (so cgi-bin) * Step 1-5 Edit this new config file with your own setup : 代碼: --- Change LogFile value with full path of your web server log file (You can also use a relative path from your awstats.pl directory). PS: Windows的部份可以改成這樣 LogFile="C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-0%MM-0Ý-0.log" 注意你的Log的路徑 --- Change LogFormat to value "2" (it means "IIS Extended W3C log format"). 如 LogFormat=2 --- Change DirIcons parameter to reflect relative path of icon directory. --- Edit SiteDomain parameter with the main domain name or the intranet web server name used to reach the web site to analyze (Example: www.mydomain.com). --- You can change other parameters if you want. --- Set your primary language. Lang="tw" Step 2 : Build/Update Statistics * Step 2-1 The first analyze/update of statistics can be made the first time manually from the command line (the first time, process may be long) : awstats.pl -config=myvirtualhostname -update PS:在這邊你可以在cgi-bin裡面寫一個bat的執行檔...如 crontab.bat 內容如下 D:\awstats\cgi-bin\awstats.pl -config=adj -update 這樣你就可以不用每次還要叫出MS-DOS...而且可以利用這個檔案來做排程... AWStats will read the config file awstats.myvirtualhostname.conf (or if not found, awstats.conf) and create/update its database with all summary information issued from analyzed log file.AWStats database files are saved in directory defined by DirData parameter in config file. When update is finished, you should get a result like this: Lines in file: 225730 Found 5 dropped records, Found 124 corrupted records, Found 0 old records, Found 225601 new records. * Step 2-2 Even if AWStats allows "real-time" statistics with its "update from browser feature" (See next section Read Statistics), you should run an update process from a scheduler (command is same than first process) frequently. You can add instructions in your crontab (Unix/Linux) or your task scheduler (for Windows), to launch frequently this Awstats update process. For sites with: - 10,000 visitors a month Launch AWStats once a day - 50,000 visitors a month Launch AWStats once every 4 hours - 250,000 visitors a month Launch AWStats once an hour - 1,000,000 visitors a month Launch AWStats once an hour This is ABSOLUTELY necessary to keep good performances. PS:這個部份是依你的Log來建議你多久做一次排程...至於怎麼做排程??我實在不知道怎麼描述...不知道的人先找資料看看好了.. Step 3 : Read Statistics 好了之後...你可以打開Browser...輸入如下: http://www.adj.idv.tw/cgi-bin/awstats.pl?config=adj Online Demo: Awstats Online 這樣就行啦...當然你還可以在IIS底下..不是有個cgi-bin嗎?按右鍵選內容進去後...目錄安全設定...編輯...匿名存取拿掉...這樣別人要看這個cgi-bin裡面的資料就要打系統裡面有的帳號密碼才看的到囉...這樣是不是有更進一層的防護呢? ********************************************************************** Windows 下可用的 Log Analyze 軟體, 比較有名的好像是 WebTrends ..當然這個也是要錢的. 不過 產生出來的圖表也很夠看. 如果是Loadbalnace的web, 也可以產生出統一流量報表.這個算是商業用的.. 用過AWSTATS之後,小弟覺得這套的報表已經很足夠了.. 另外Mutil-domain 在 IIS 的方面..做法上 AWSTATS 的config 依不同Domain外.每個設定檔 AWSTAT.XXX.conf .設定檔裡Log位置 ,再依IIS Virtual Site 下Log存放位罝不同修改即可.. (預設是 c:/winnt/system32/Logfiles/W3SVC1 (W3SVC2 ,W3SVC3 依此類推) LogFormat = 2 (IIS format ) 其他的大致和 安裝在Linux下環境差不多。。 使用心得:: Report 的速度還滿快的. Loading 也不怎麼重. 還有可以即時跑Report (AllowToUpdateStatsFromBrowser=1) 觀看時開Frames ( UseFramesWhenCGI=1) 還有一些比較特別的設定.. 真的有夠強..!! ********************************************************************* 實在太好了
------
**********************************************************
哈哈&兵燹
最會的2大絕招 這個不會與那個也不會 哈哈哈 粉好

Delphi K.Top的K.Top分兩個字解釋Top代表尖端的意思,希望本討論區能提供Delphi的尖端新知
K.表Knowlege 知識,就是本站的標語:Open our mind
系統時間:2024-05-17 17:56:18
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!