사이트 내 전체검색
[Ubuntu] Awstats웹로그분석 (접속지역별)tool
로빈아빠
https://cmd.kr/server/636 URL이 복사되었습니다.

본문

출처 by 블루비 : http://blueb.net/blog/1458

ubuntu + Awstats 웹로그분석 툴 설치

1.awstats 패키지를 설치한다
# apt-get install awstats


2. /etc/awstats/awstats.호스트네임.conf 로 설정 파일을 다음과 같이 만든다.
/etc/awstats/awstats.blueb.net.conf
LogFile="/var/log/apache2/blueb.net.access.log"
LogFormat=1
DNSLookup=1
DirData="/var/lib/awstats/"
DirCgi="/cgi-bin"
DirIcons="/icon"
SiteDomain="blueb.net"
AllowToUpdateStatsFromBrowser=1
AllowFullYearView=3


3. /var/lib/awstats 권한을 확인한다. 
기본적으로 www-data 사용자로 생성이 되기 때문에 따로 권한 설정할 필요가 없다.
(수집된 로그 데이터가 저장되는 저장소이다.)

4.그림파일들을 복사한다.
# cp -r /usr/share/awstats/icon /var/www/icon


5. 로그정보를 업데이트 한다.
# /usr/lib/cgi-bin/awstats.pl -config=blueb.net -update


6. 브라우저로 확인해본다.
http://blueb.net/cgi-bin/awstats.pl?config=blueb.net


7. 한시간 단위로 업데이트 된 로그정보를 보기 위해 crontab 에 설정하고 마무리
# crontab -e
00 * * * * /usr/lib/cgi-bin/awstats.pl -config=blueb.net -update

 

샘플이미지

http://blueb.net/blog/attach/1/1277428029.jpg 

 

 

8. GeoIP와 연동방법

# vi    /etc/awstats/awstats.conf

<-- 아래 주석제거  -->
LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"
LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPRegion.dat"

 

 

#  /usr/lib/cgi-bin/awstats.pl -config=blueb.net   -update

아래 에러발생시

Error: Plugin load for plugin 'geoip' failed with return code: Error: Can't locate Geo/IP.pm in @INC (@INC contains: /usr/local/lib/perl5/5.10.1/BSDPAN /usr/local/lib/perl5/site_perl/5.10.1/mach /usr/local/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/5.10.1/mach /usr/local/lib/perl5/5.10.1 . /usr/local/www/awstats/cgi-bin/lib /usr/local/www/awstats/cgi-bin/plugins) at (eval! 4) line 1. Can't locate Geo/IP/PurePerl.pm in @INC (@INC contains: /usr/local/lib/perl5/5.10.1/BSDPAN /usr/local/lib/perl5/site_perl/5.10.1/mach /usr/local/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/5.10.1/mach /usr/local/lib/perl5/5.10.1 . /usr/local/www/awstats/cgi-bin/lib /usr/local/www/awstats/cgi-bin/plugins) at (eval! 5) line 1. Error: Need Perl module Geo::IP or Geo::IP::PurePerl

 

해결방법

# cpan Geo::IP::PurePerl Geo::IP


댓글목록

등록된 댓글이 없습니다.

1,139 (4/23P)

Search

Copyright © Cmd 명령어 18.188.249.30