AWStats 웹상태 분석기

http://awstats.sourceforge.net




웹로그분석기 설치기 - Awstats


글쓴이 : 문용우 (2004년 03월 03일 오전 10:56)

수정이 : 김정언(2005년 8월 18일 오후 2:23)


####################################
# HowTo - Awstats 웹로그 분석 설치 #
# #
# 2004.03.03 linuxxer #
# 2005.08.21 jkim #

####################################

* Webalizer 를 많이 사용하시지만 awstats는 좀더 화려한(?) 인터페이스와다양한 정보를 제공해줍니다.


[목차]

1. 준비사항
2. Setup / Configure
3. Complete

4. 기타

5. 질의응답



1. 준비사항

프로젝트 싸이트 : http://awstats.sourceforge.net
다운로드 : awstats-6.4.tgz (2005년 8월 현재 stable한 버전)

웹로그분석이기 때문에 Web Server는 이미 설치가 되어 있어야 합니다.
( Apache 설치문서는 많이 있기 때문에 별도 설명을 하지 않음을 양해해 주시기 바랍니다. )

2. Setup / Configure

다운로드 받은 압축파일을 푸시면 docs 디렉토리안에 *.html 파일들이
Install 방법과 Plug-in사용법등 다양하게 정보를 같이 제공하고 있읍니다.
(프로젝트 홈페이지에 Install 방법 없읍니다.

꼭 *.html 을 보세요.

FAQ도 꼭 보기를 권합니다. 전부를 읽을 필요는 없지만 궁금해 하는 것에 대한 대다수의 해답을 찾을 수 있을 겁니다.

)



tar xvfz awstats-6.4.tgz
mv -rf awstats-6.4 /usr/local/awstats
chmod -R 755 /usr/local/awstats
mkdir /etc/awstats <- configuration 파일 저장위치
mkdir /var/lib/awstats <- 분석한 데이타 저장 위치

cd /usr/local/awstats/tools


./configure.pl <- awstats를 실행하는데 필요한 환경을 자동으로 만들어주기 위한 스크립트쯤으로 생각하면 됩니다.



(예)

[root@www tools]# ./awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.4) (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'
Warning: You Apache config file contains directives to write 'common' log files
This means that some features can't work (os, browsers and keywords detection).
Do you want me to setup Apache to write 'combined' log files [y/N] ? y
Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
Add '' directive
AWStats directives added to Apache config file.

-----> 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.sample.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.sample.com.conf'
Config file /etc/awstats/awstats.www.sample.com.conf created.

-----> Restart Web server with '/sbin/service httpd restart'
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

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

Press ENTER to finish...

[root@www tools]#



여기까지 잘 따라 하셨다면 에러가 없을겁니다.

configure.pl 을 잘 실행 시키셨다면 자신이 정한 name으로 awstats.[정한 name].conf 파일이 생성되어 있을겁니다.


이 파일을 열어 LogFile= 항목을 자신의 웹로그가 위치한 절대경로를 입력합니다.

(예)

LogFile="/var/log/httpd/mylog.log"

이것을

LogFile="[자신이 사용하는 웹서버의 access 로그]"


제가 사용하는 예를 보여드리면
LogFile="/usr/local/apache/logs/access_log"



/usr/local/awstats/tools/ 아래보시면 httpd_conf 파일이 있읍니다.
이 파일을 vi로 여셔서 내용전체를 웹서버가 설치된 conf/httpd.conf 파일의 맨 하단에
붙여넣으시면 됩니다.

:wq



awstats-6.4 설치시에는 httpd.conf 내에 자동으로 아래부분이 추가 되었습니다.

혹시 추가 되지 않았다면 시스템설정에 맞게 추가해주셔야합니다.

...
#
# Directives to allow use of AWStats as a CGI
#
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.
#

Options None
AllowOverride None
Order allow,deny
Allow from all





3. Complete

간단하게 다 되었습니다 이제 웹브라우져로 확인을 해보겠습니다.

http://[웹서버]/awstats/awstats.pl?config=[자신이 정한 name]

한글화도 아주 잘 되어 있읍니다.

(설정파일에 language가auto로 되어 있어 사용자의 PC환경에 맞게 출력됩니다.)


자... 웹로그분석이니 Cron 작업도 빼 먹으면 안되겠죠?

vi /etc/crontab 하셔서
0-59/6 * * * * root /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=[자신이 정한 name]

:wq

로그분석 시간간격은 조정하시면 됩니다.



4. 기타

4.1. config파일에 설정된 기본 로그파일이 아닌 백업받아놓은 임의의 파일을 분석하고자 할 때는 다음과 같이 -LogFile 옵션으로 해결할 수 있다.

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile=/usr/local/apache/logs/www.sample.com-access_log.1



4.1. DNS REVERSE LOOKUP

awstats 배포할 때 같이 배포되는 logresolvemerge.pl 로 접속하는 ip를 hostname으로 reverse lookup 할 수있다.

/usr/local/awstats/tools/logresolvemerge.pl -dnslookup

하면 간단한 설명을 볼 수 있다.



(예1) 백업되어 있는 로그파일을 pipe를 통해 분석한다.

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile="/usr/local/awstats/tools/logresolvemerge.pl -dnslookup ./www.sample.com-access_log |"



(예2)백업되어 있는 로그파일을 pipe를 통해 분석한다.
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile="/usr/local/awstats/tools/logresolvemerge.pl -dnslookup ./www.sample.com-access_log.1 |"
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2006/10/20 18:48 2006/10/20 18:48
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2041

한 늙은 인디언 추장이 자기 손자에게 말했습니다.

" 얘야, 우리 모두의 마음 속에서 두 늑대가 싸우고 있단다. 한 마리는 악한 늑대로 그 놈이 가진 것은
화, 질투, 슬픔, 후회, 탐욕, 거만, 자기 동정, 죄의식, 회한, 열등감, 거짓, 자만심, 우월감 그리고 이기심 이란다.
다른 한 마리는 좋은 늑대로, 그가 가진 것은
기쁨, 평안, 사랑, 소망, 인내심, 평온함, 겸손, 친절, 동정심, 아량, 진실 그리고 믿음이란다. "
"어떤 늑대가 이기나요?" 손자가 묻자, 추장은 간단하게 대답했습니다.
"내가 먹이를 주는 놈이 이기지."

할수 있다는 생각이 든다면 그 생각이 옳습니다. 할 수 없다는 생각이 든다면 그 생각도 옳습니다. 반드시 그렇게 됩니다.

//------

내가 먹이를 주는 것은 어느 것일까?
오늘 수영장에서 물을 많이 먹었다.
갈수록 많이 먹네.....

배불러~! ㅋㅋㅋ
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2006/10/20 09:27 2006/10/20 09:27
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2040

&quot;그럴 수도 있지&quot;

우리는 그럴 수도 있는 일 때문에
사람의 마음에 상처를 남기며 살고 있지는
않습니까? 내 마음에 들지 않게 일을 했어도
"그럴 수도 있지"라고 말해봅시다.
그러면 한결 좋아진, 따뜻한 기분을
느낄 것입니다.


- 김홍식의《우리에게 가장 소중한 것은》중에서 -


* 완전한 사람은 없습니다.
누구든 부족함이 있고 실수도 있습니다.
그 부족함과 실수의 징검다리를 잘 건너야
더 큰 사람이 될 수 있습니다.
"그럴 수도 있지"
사랑과 이해와 관용이 담긴,
참으로 따뜻하고 아름다운 말입니다.
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2006/10/20 09:19 2006/10/20 09:19
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2039


블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2006/10   »
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        
Statistics Graph

Site Stats

Total hits:
180101
Today:
247
Yesterday:
243