RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
'awstats'에 해당되는 글 1
2009.07.24  AWstats 설치법  
기본적으로 awstats는 설치를 따로 하지 않고 압축을 풀기만 하면 됩니다.
최신버전에서는 기본적으로 한글을 지원하므로 별다른 한글패치를 하지 않고도 한글로 볼 수 있는 장점이 있습니다.
awstats는 웹로그 이외에도 ftp, mail 로그를 지원합니다.

설치
http://awstats.sourceforge.net/?seenIEPage=1 에서 awstats를 다운 받습니다.
last stable  : awstats-6.7.tar.gz

# wget http://prdownloads.sourceforge.net/awstats/awstats-6.7.tar.gz
# tar zxf awstats-6.7.tar.gz

awstats에 필요한 디렉토리를 만들어 줍니다.
# mkdir /etc/awstats         -----------> awstats의 conf 파일이 저장되는 장소
# mkdir /var/lib/awstats    -----------> awstats의 로그분석이 저장되는 장소

그리고 풀린 awstats를 설치하고픈 곳에 다가 옮겨줍니다. 여기에서는 /usr/loca/awstats로 옮깁니다.
# mv awstats-6.7 /usr/local/awstats

그리고 권한 설정을 잡아줍니다.
# chmod 755 /usr/local/awstats
# chown -R root.root /usr/local/awstats
이렇게만 하면 설치는 끝납니다.

설정
설정은 아래와 같이 awstats에서 지원하는 파일로 파일을 생성하는 방법이 있지만,
그냥 이미 만들어진 conf 파일을 고쳐서 써도 무방합니다.
# /usr/local/awstats/tools/awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.7) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file '/usr/local/apache/conf/httpd.conf'

-----> Check and complete web server config file '/usr/local/apache/conf/httpd.conf'
  AWStats directives already present.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> 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

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
domain

-----> 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):

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=aaa
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...

A SIMPLE config file has been created: /etc/awstats/awstats.aaa.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'aaa' with command:
> perl awstats.pl -update -config=domain
You can also read your statistics for 'aaa' with URL:
> http://localhost/awstats/awstats.pl?config=domain

Press ENTER to finish...

이렇게 하면 /etc/awstats 디렉토리 안에 awstats.domain.conf 라는 파일이 생성이 되고 /usr/local/apache/conf/httpd.conf 안에
    # awstats alias
    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/"

    # This is to permit URL access to scripts/files in AWStats directory.
    <Directory "/usr/local/awstats/wwwroot">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
의 정보가 들어갑니다.  기본적으로 /usr/local/apache와 /usr/local/apacheSSL이 설치된 몇몇 서버에는 apacheSSL의 httpd.conf 에 자동으로 들어가지 않아 직접 입력해주면 됩니다.

awstats.domain.conf
awstats는 기본적으로 apache log 방식을 combined을 기본으로 하고 있습니다. 물론 common방식으로 사용이 가능하지만 좀더 세밀한 분석을 위해서는 combined방식을 추천합니다. 설정에 꼭 필요한 것만 집고 넘어가겠습니다.

51째 줄: 아파치 로그 파일 위치
LogFile="/usr/local/apache/logs/dongabiz-access_log"

122째 줄: 1(combined), 4(common) 로그 포멧을 설정하는  곳인데 기본적으로 1번으로 잡혀있습니다.
LogFormat=1

153째 줄 : 표기 될 도메인 이름
SiteDomain="www.dongabiz.com"

892쨰 줄 : 표시될 언어 설정(기본은 auto인데 ko로 잡어줍니다)
Lang="ko"

이 정도만 잡아주면 문제 없이 로그를 뽑을 수 있습니다.

* 로그 분석 실행하기
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=domain

* 로그 페이지 보기
http://domain/awstats/awstats.pl?config=domain


awstats plug-in
awstats는 plug-in 기능을 이용하여 좀 더 강력한 분석이 가능합니다.
여기에서는 GeoIP를 이용하여 어느나라에서 접속을 하였는지를 확인 할 수 있도록 하겠습니다.

* GeoIP 다운로드
# wget http://www.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-1.19.tar.gz
# wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz

pureperl 버전 GeoIP를 설치합니다.
# tar zxf Geo-IP-PurePerl-1.19.tar.gz
# cd Geo-IP-PurePerl-1.19
# perl Makefile.PL && make && make install

GeoIP의 국가별 data 을 설치합니다. (단순히 압축만 풀면됩니다.)
# gzip -d GeoIP.dat.gz
# mkdir /usr/local/share/GeoIP
# mv GeoIP.dat /usr/local/share/GeoIP

* 설정
awstats.domain.conf에 설정을 합니다.
1289번째 줄
LoadPlugin="geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"

* XWhois
웹상에서 바로 whois를 효과를 낼 수 있는 플러그인. 약간에 버그가 있어서 호스트가 whois.xxx.xxxx.xxxx 인 4자리로 구분된 호스트는 찾아지지 않습니다.
# tar zxf Net-XWhois-0.90.tar.gz
# cd Net-XWhois-0.90
# perl Makefile.PL && make && make install

* 설정
awstats.domain.conf에 설정을 합니다.
1365번째 줄의 주석을 푼다
LoadPlugin="hostinfo"

검색엔진 추가하기
awstats는 외국산 웹로그 분석툴이기 때문에 유명한 검색엔진(google, yahoo 등)을 제외한 국내 엔진은 전부 Unknown으로 판단합니다. 이에 국내 엔진을 판별하기 위해 파일을 수정하여 줍니다. 이는 설명이 길어지기에 국내엔진이 추가된 파일을 첨부하였습니다.

첨부 파일을 다운받아서 아래와 같이 실행합니다.
# rm -f /usr/local/awstats/wwwroot/cgi-bin/lib/search_engines.pm
# mv search_engines.pm /usr/local/awstats/wwwroot/cgi-bin/lib/


Trackback
Reply
우주곰:지구곰이 아닙니다.
지구곰이 아닙니다.
Categories (190)
Information (5)
About uzoogom (5)
My Advanced Linux (73)
Learning Linux (96)
OperatingSystem (5)
Databases (4)
OpenSource (1)
Tips! (1)
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31