※XcodeToolsとMacportsはインストール済みであること。
sudo port install awstats する。
最後に
Add the following to your Apache httpd.conf, save, and restart Apache:
Alias /awstatsclasses “/opt/local/www/awstats/classes/”
Alias /awstatscss “/opt/local/www/awstats/css/”
Alias /awstatsicons “/opt/local/www/awstats/icons/”
ScriptAlias /awstats/ “/opt/local/www/awstats/cgi-bin/”
Options None
AllowOverride None
Order allow,deny
Allow from all
Find your sample config file in /opt/local/etc/awstats, rename it to
“awstats.domain_name.conf”, and edit it to configure Awstats. You
can then access Awstats by pointing your browser to:
http://yourdomain/awstats/awstats.pl
と言ってくるが、
/etc/apache2/httpd.conf には
ScriptAlias /awstats/ “/opt/local/www/awstats/cgi-bin/”
Options None
AllowOverride None
Order allow,deny
Allow from all
しか入れない。CSS外部ファイルじゃないし,iconsはそんなところにあっても塩梅悪い。
ついでに
CustomLog “/private/var/log/apache2/access_log” combined
になっているか、確認する。
なってなければそうして、既存のaccess_logをoldにする。
mv /private/var/log/apache2/access_log /private/var/log/apache2/access_log.old
touch /private/var/log/apache2/access_log
apachectl restart
そして
sudo port install libgeoip
sudo cpan -i Geo::IP
しとく。
cp -r /opt/local/www/awstats/cgi-bin/icons /Library/WebServer/Documents/
して
sudo cp /opt/local/etc/awstats/awstats.model.conf awstats.ドメイン名(このconfの中も同じもの).conf
そして
vi /opt/local/etc/awstats/awstats.ドメイン名(このconfの中も同じもの).conf
LogFile=”/var/log/apache2/access_log”
SiteDomain=”ドメイン名”
HostAliases=”ドメイン名”
DNSLookup=1
DirData=”/opt/local/var/lib/awstats”
DirCgi=”/awstats/cgi-bin”
DirIcons=”/icons”
AllowFullYearView=3
SkipHosts=”127.0.0.1 localhost REGEX[^192.168.] ::1″
LoadPlugin=”geoip GEOIP_STANDARD /opt/local/share/GeoIP/GeoIP.dat”
と修正する。
/opt/local/www/awstats/cgi-bin/awstats.pl -config=さっき設定したドメイン名
で、http://ドメイン名/awstats/awstats.pl
を見に行くと見えている。