Skip to content

2008.12.25 22:28

AWSTATS 설치

조회 수 23661 추천 수 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 [정보] [Apache+PHP] Segmentation Fault가 발생할 경우 ADMINPLAY 2012.07.27 47812
87 Apache 웹페이지 한글깨짐, AddDefaultsCharset 설정 file ADMINPLAY 2009.01.03 30520
86 서비스 제한측면의 아파치 활용 예제 ADMINPLAY 2012.06.26 30318
85 make[2]: *** [htpasswd] 오류 1 , make[1]: *** [all-rec... ADMINPLAY 2009.08.07 27100
84 *** glibc detected *** double free or corruption (!pre... ADMINPLAY 2010.05.03 26742
83 Address already in use: make_sock:could not bind to ad... ADMINPLAY 2009.01.10 23798
» AWSTATS 설치 ADMINPLAY 2008.12.25 23661
81 apache cronolog를 이용한 Apache Log File 날짜 별로 생... ADMINPLAY 2012.01.16 23504
80 Apache mod_deflate ADMINPLAY 2012.01.16 23376
79 apache, tomcat 가상디렉토리 설정 file ADMINPLAY 2010.09.17 23003
78 APM 기본설치후 아파치 실행에러 httpd: Could not determ... ADMINPLAY 2009.08.08 21875
77 Unclean shutdown of previous Apache run? ADMINPLAY 2009.08.05 21795
76 Apache: client denied by server configuration ADMINPLAY 2010.10.25 21665
75 mod_deflate 설정 ADMINPLAY 2011.03.18 21236
74 apache 외부링크 차단 ADMINPLAY 2010.08.31 21221
73 [LINUX] Apache 2.2 + mod jk 1.2 + Tomcat 5.x 연동 ADMINPLAY 2009.05.07 21037
72 아파치에서 멀티도메인 설정 방법 1 l2zeo 2012.10.09 20972
71 Apache 로그레벨의 종류 ADMINPLAY 2012.01.16 20842
70 APM + Snort + ADODB + BASE + oinkmaster 설치 l2zeo 2010.05.29 20816
69 리눅스 개인계정 로딩시 틸드(~)기호없이 그냥 사용 ADMINPLAY 2010.09.22 20684
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234