Skip to content

2008.12.25 22:28

AWSTATS 설치

조회 수 23606 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

1. 설치방법
OS : LINUX
WebServer : Apache
현재 버전은 6.8까지 나온상태..http://awstats.sourceforge.net/?seenIEPage=1 에서 다운받으면 됩니다.

 

다운받은 파일은 서버에다가 옮겨놓고 다음과 같이 실행합니다.
tar xvfz awstats-6.8.tar.gz
mv awstats-6.8/ /usr/local/awstats
chmod 755 /usr/local/awstats
mkdir /etc/awstats
mkdir /var/lib/awstats <- 기본적으로 분석된 로그가 쌓이는 위치입니다.

cd /usr/local/awstats/tools
./awstats_configure.pl

 

실행할경우 아래와 같이 물어봅니다.(awstat 버전따라 조금 다르게 나올수 있음)


----- AWStats awstats_configure 1.0 (build 1.8) (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'
  All AWStats directives are 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:
> www.xxxx.com (웹로그분석을 하고자 하는 사이트명을 적어주시면 됩니다.)

 

-----> 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):
> (그냥 엔터칩니다)

 

-----> Create config file '/etc/awstats/awstats.www.xxx.com.conf'
 Config file /etc/awstats/awstats.www.xxx.com.conf created.

 

-----> 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=www.xxx.com
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.www.xxx.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.xxx.com' with command:
> perl awstats.pl -update -config=www.xxx.com

You can also read your statistics for 'www.xxx.com' with URL:
> http://localhost/awstats/awstats.pl?config=www.xxx.com

Press ENTER to finish...

 

이렇게 되면서 1차적으로 설치는 완성됩니다.

 

2.

 1) conf 파일 수정
   위에서 Define config file path 부분에 넣었던 (전 그냥 디폴트로 엔터를 쳤지요)
   /etc/awstats 로 가시면 awstats.www.xxx.com.conf 파일이 있습니다.
   이제 이걸 수정해야겠지요
   vi awstats.www.xxx.com.conf 의 51번째 라인을 보시면

   LogFile="/var/log/httpd/mylog.log" 라고 있습니다.

 

   이것을 LogFile="[자신이 사용하는 웹서버의 access 로그]" 를 지정하시면 됩니다.
   저는 apache 의 로그를 /var/log/httpd/access_log 로 사용하고 있으므로

   LogFile="/var/log/httpd/access_log" 로 변경했습니다.

 

    로그파일 위치변경 : DirData 부분을 보시면 DirData="/var/lib/awstats" 로 되어있는데 보기가 좀 불편할 수 있으니
    저는 /usr/local/awstats/ 디렉토리밑에 logs 라고 디렉토리를 만들었습니다.

    그리고 DirData="/usr/local/awstats/logs" 로 변경했습니다.

 

    한글설정하기

    Lang="auto" 를 Lang="ko" 로 수정합니다.

 

 2) httpd.conf 파일 수정

    apache 의 httpd.conf 파일을 수정을 좀 해야합니다.
    /usr/local/atstats/tools/ 의 httpd_conf 파일을 열어보시면 내용이 나오는데 이 내용전체를
    apache 의 httpd.conf 파일 맨 하단에 붙여넣으세요
    저는 httpd.conf 파일이 /etc/httpd/conf/httpd.conf 에 있군요

 

 3) cron 에 등록하기
    vi /etc/crontab 파일에 다음과 같이 추가를 합니다. 업데이트 주기는 사용자가 많으면 좀 짧게해주면 되겠죠..
    0 0 * * * root /usr/local/awstats/wwwroot/cgi-bin/awstats -update -config=www.pcbang.net

 

3. 마무리 작업

   apachectl restart 로 아파치를 재구동 시켜줍니다.
   웹페이지에서 확인하기 : http://도메인주소/awstats/awstats.pl?config=www.xxx.com
   그런데 별로 보이는것이 없다고요??
   왜냐면 크론이 돌지 않았기 때문이죠..지금 당장 보고 싶다면
   /usr/local/awstats/wwwroot/cgi-bin/awstats -update -config=www.xxx.com 를 실행하신 후 웹에서 보시면 됩니다.


List of Articles
번호 제목 글쓴이 날짜 조회 수
88 64bit 시스템에 ssl 설치 후 실행 시 X509_free 오류 ADMINPLAY 2008.10.07 15507
87 서비스 동시접속 인원알기 ADMINPLAY 2008.10.07 16892
86 사이트가 느려지는 현상 점검 ADMINPLAY 2008.10.08 15933
85 apache 2.0.x , 2.2.x 버전대 max client 값 수정시 ADMINPLAY 2008.10.08 14799
84 아파치 특정폴더에 암호걸기 ADMINPLAY 2008.10.08 16032
83 httpd.conf 파일에 대한 설명 / 번역 ADMINPLAY 2008.10.08 14196
82 Apache 최적화 ADMINPLAY 2008.11.11 15768
81 아파치 모듈 내용 ADMINPLAY 2008.12.10 15905
80 apache log 정리 ADMINPLAY 2008.12.14 13527
79 CGI 오류: Premature end of script headers (Internal Se... 1 ADMINPLAY 2008.12.14 14127
78 Apache 버전확인 ADMINPLAY 2008.12.23 15428
» AWSTATS 설치 ADMINPLAY 2008.12.25 23606
76 AWSTATS 국가별 사용자 분석 ADMINPLAY 2008.12.25 14463
75 웹페이지에서 한글이 깨지는 현상 막기 ADMINPLAY 2009.01.03 16528
74 Apache 웹페이지 한글깨짐, AddDefaultsCharset 설정 file ADMINPLAY 2009.01.03 30520
73 Address already in use: make_sock:could not bind to ad... ADMINPLAY 2009.01.10 23798
72 CGI 퍼미션 으로 웹페이지 열리지 않음 ADMINPLAY 2009.01.12 14674
71 아파치 2.X 버전에서 mod_cband를 이용한 트래픽관리 file ADMINPLAY 2009.01.17 19017
70 RedirectMatch (도메인포워딩) ADMINPLAY 2009.01.23 15435
69 리눅스 APM 소스설치시 에러에 대한 대처 1 ADMINPLAY 2009.01.30 15132
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234