星期三, 12月 13, 2006

How to setup awstats

rpm -ivh awstats-6.4-1.noarch.rpm

----- AWStats 6.4 - Laurent Destailleur -----
AWStats files have been installed in /usr/local/awstats

If first install, follow instructions in documentation
(/usr/local/awstats/docs/index.html) to setup AWStats in 3 steps:
Step 1 : Install and Setup with awstats_configure.pl (or manually)
Step 2 : Build/Update Statistics with awstats.pl
Step 3 : Read Statistics

---------------------------------------
cd /usr/local/awstats/tools/
perl awstats_configure.pl

Enter full config file path of your Web server.
Config file path ('none' to skip web server setup):
> /etc/httpd/conf/httpd.conf
-----> 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

Your web site, virtual server or profile name:
> 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,使用預設資料夾來放置設定檔

---------------------------------------
chmod 755 /usr/local/awstats
mkdir /var/lib/awstats

---------------------------------------
vi /etc/awstats/awstats.www.conf
LogFile="/var/log/httpd/access_log"
SiteDomain="domain.com"
DNSLookup=1
HostAliases="192.168.0.3 127.0.0.1 localhost"
---------------------------------------
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www -update
service httpd restart
http://ip/awstats/awstats.pl?config=www
---------------------------------------
#定時更新
vi /etc/crontab
50 3 * * * root /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www -update >/dev/null 2>&1

2.若有多個設定檔要執行的話可以執行
/usr/local/awstats/tools/awstats_updateall.pl now
vi /etc/crontab
0 23 * * * root /usr/local/awstats/tools/awstats_updateall.pl now >/dev/null 2>&1

沒有留言: