Skip to content

2008.12.25 22:28

AWSTATS 설치

조회 수 23673 추천 수 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 CentOS 5.X 에 MRTG설치 할때 한글 문제 ADMINPLAY 2014.06.06 6874
87 [Apache] 2.4 버전에서 403 에러시 [authz_core:error AH0... ADMINPLAY 2015.01.09 7276
86 SetEnvIf 지시어 설명 (mod_setenvif) ADMINPLAY 2014.01.18 7383
85 tomcat 에서 OutOfMemory에러가 발생할때 ADMINPLAY 2013.09.09 8765
84 APM설치 후 80포트가 연결이 안되요....ㅜㅜ 1 kimbongsoo 2013.02.14 9801
83 apache 설치시 에러 발생 collect2: ld returned 1 exit s... ADMINPLAY 2013.03.12 9809
82 WAS 란? WAS 뭐에요? file ADMINPLAY 2014.01.19 10961
81 우분투9.10 - Tomcat6 와 Apache2연동 ADMINPLAY 2012.10.31 11400
80 Apache expires 설정으로 브라우저 캐시 l2zeo 2013.03.18 11891
79 웹페이지 가속 기술인 모드 페이지스피드(mod_pagespeed)... l2zeo 2013.01.27 12143
78 Apache 1.3.12 httpd.conf 파일 한글설명 ADMINPLAY 2009.03.04 13361
77 apache log 정리 ADMINPLAY 2008.12.14 13527
76 [자료] 웹사이트 성능개선 위한 커널 튜닝 사례 ADMINPLAY 2009.05.10 13767
75 Apache 웹서버 MaxClient 최대값 조정을 위한 C & CPP 플... ADMINPLAY 2009.06.21 13815
74 사용자 인증 ADMINPLAY 2009.11.26 14017
73 CGI 오류: Premature end of script headers (Internal Se... 1 ADMINPLAY 2008.12.14 14127
72 SSL 인증서 발급 후 SSL mode 시작시 두 개의 패스워드 입... ADMINPLAY 2009.10.15 14176
71 httpd.conf 파일에 대한 설명 / 번역 ADMINPLAY 2008.10.08 14196
70 apache 에서 euc-kr홈페이지를 포팅할때 화면이안나올경우 ADMINPLAY 2009.07.18 14217
69 rewrite 모듈을 이욜한 서브도메인으로 홈페이지 운영하기 ADMINPLAY 2009.11.26 14217
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234