2011年9月19日 星期一

AWStats for apache 產生分析

產生分析 apache log 的 AWStats 設定檔
perl awstats_configure.pl
----- 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
 
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
#輸入 web server 設定檔位置
 
-----> Check and complete web server config file '/etc/httpd/conf/httpd.conf'
AWStats directives already present.
 
-----> Update model config file '/etc/awstats/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
#輸入 y,產生新的 AWStats 設定檔
 
-----> 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:
> www
#輸入 www,為設定檔取個名字,此檔名可自取
 
-----> 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):
>
#直接按下 Enter,使用預設資料夾來放置設定檔
 
-----> Create config file '/etc/awstats/awstats.www.conf'
Config file /etc/awstats/awstats.www.conf created.
 
-----> Restart Web server with '/sbin/service httpd restart'

停止 httpd: [ 確定 ]
啟動 httpd: [ 確定 ]
 
-----> 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=www
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.www.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www' with command:
> perl awstats.pl -update -config=www
You can also read your statistics for 'www' with URL:
> http://localhost/awstats/awstats.pl?config=www
 
Press ENTER to finish...
chmod 755 /usr/local/awstats
mkdir /var/lib/awstats
修改設定檔
cp /etc/awstats/awstats.www.conf /etc/awstats/awstats.www.conf.bak
vi /etc/awstats/awstats.www.conf
51行 LogFile="/var/log/httpd/mylog.log" 修改成--> LogFile="/var/log/httpd/access_log"
153行 SiteDomain="www" 修改成--> SiteDomain="xxx.xxx.edu.tw"
188行 DNSLookup=2 修改成--> DNSLookup=1
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www -update
/etc/rc.d/init.d/httpd restart
測試:http://IP/awstats/awstats.pl?config=www
http://IP/awstats/awstats.pl?config=mail

http://163.17.209.5/awstats/awstats.pl?config=mail
http://163.17.209.3/awstats/awstats.pl?config=www

沒有留言:

張貼留言