在OpenSolais上的安装与配置awstats

Posted by 4Aiur on 09/17/2010 in OpenSolaris |

在OpenSolais上的安装与配置awstats

安装awstats

# pkgin in awstats

安装GeoIP

# pkgin in GeoIP

安装perl的GeoIP模块

# Geo::IP::PurePerl
# wget http://geolite.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-1.25.tar.gz
# gtar zxf Geo-IP-PurePerl-1.25.tar.gz
# cd Geo-IP-PurePerl-1.25
# perl Makefile.PL 
# make
# make test
# make install

下载GeoCity库

# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gzip -d GeoLiteCity.dat.gz
# mv GeoLiteCity.dat /opt/local/share/GeoIP/

配置apache的虚拟主机

# cd /opt/local/etc/httpd/virtualhosts/
# vi blog.4aiur.net.conf

    ServerName blog.4aiur.net
    DocumentRoot /home/4aiur/web/blog.4aiur.net/
    DocumentRoot /home/4aiur/web/blog.4aiur.net/
    CustomLog /home/4aiur/web/logs/blog.4aiur.net_access_log combined
    ErrorLog /home/4aiur/web/logs/blog.4aiur.net_error.log
    
        Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    
    Alias /awstatsclasses "/usr/local/awstats/classes/"
    Alias /awstatscss "/usr/local/awstats/css/"
    Alias /awstatsicons "/usr/local/awstats/icon/"
    ScriptAlias /awstats/ /usr/local/awstats/cgi-bin/
    
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    
# svcadm restart apache

配置awstats配置文件

# cd /opt/local/etc/awstats/
# mv awstats.model.conf awstats.blog.4aiur.net.conf
# vi awstats.blog.4aiur.net.conf
LogFile="/home/4aiur/web/logs/blog.4aiur.net_access_log"
SiteDomain="blog.4aiur.net"
HostAliases="localhost 127.0.0.1 REGEX[4aiur\.net$]"
DNSLookup=0
DirIcons="/awstatsicons"
SkipFiles="REGEX[^\/wp-]"
LoadPlugin="geoip GEOIP_STANDARD /opt/local/share/GeoIP/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /opt/local/share/GeoIP/GeoLiteCity.dat"

增加日志分析程序到crontab

0 * * * * /opt/local/awstats/bin/awstats_updateall.pl now >/dev/null 2>&1

访问方式
http://blog.4aiur.net/awstats/awstats.pl?config=blog.4aiur.net

Tags: ,

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.