centos下awstats安装

tar zxvf awstats-7.0.tar.gz
cp awstats-7.0/docs/* htdocs/
cp -rf awstats-7.0 /usr/local/awstats
perl /usr/local/awstats/tools/awstats_configure.pl
vim /etc/httpd/conf/httpd.conf
加入http配置文件中
DocumentRoot "/usr/local/awstats/wwwroot"
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/"

vim /etc/awstats/awstats.test.conf
LogFile="/data/wslogs/www.test.com-access.log_%YYYY-0%MM-0%DD-24" #修改后的
#awstats数据目录
DirData="/var/lib/awstats" #默认
DirIcons="/icon" #默认
mkdir /data/wslogs
#若本服务器为nginx或要日志分析的所在服务器,则可不建立该目录,该目录主要作用是存放已按天切割完成的日志,交给awstats
#创建IP库的存放路径
mkdir /usr/local/share/GeoIP
#生成数据文件,其默认存放在/var/lib/awstats
/usr/local/awstats/tools//usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=test

/usr/bin/htpasswd -c /usr/local/awstats/apachepasswd admin  创建密码文件,用户名admin
vim /etc/httpd/conf/httpd.conf
<Directory "/usr/local/awstats/wwwroot/">
   Options Indexes MultiViews Includes FollowSymLinks +ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthType Basic
  AuthName "Restricted Files"
  AuthUserFile /usr/local/awstats/apachepasswd
  Require user pinladmin
</Directory>

#测试
http://test/awstats/awstats.pl?
注1:test既为服务器IP或域名,同时又为配置文件名
注2:创建awstats数据文件时,需按日志时间从最早开始依次创建,否则会出现仅显示第一个创建时间之后的数据,该时间之前的不会显示

#安装IP库插件
tar zxvf Geo-IP-PurePerl-1.25.tar.gz
mv Geo-IP-PurePerl-1.25 /usr/local/awstats/Geo-IP-PurePerl
cd /usr/local/awstats/Geo-IP-PurePerl/
perl Makefile.PL
make
make install

GeoIP.dat.gz
vi /etc/awstats/awstats.test.conf
追加
LoadPlugin=”decodeutfkeys”
LoadPlugin=”geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat”
#还可以加入城市IP库,方法类似
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章