2022년 7월 24일 일요일

웹로그 분석 Awstats 설치하기

 

Awstats설치하기

  • 다운로드 URL - https://awstats.sourceforge.io/

  • 압축풀기&툴 이동

$> tar -zxvf awstats-7.3.tar.gz
$> mv awstats-7.3 /usr/local/awstats/
  • awstats 설정

$> cd usr/local/awstats/
$> mkdir etc; mkdir logs
$> cp wwwroot/cgi-bin/awstats.model.conf ./etc/test.kr

* /usr/local/awstats/tools/awstats_configure.pl 파일로도 설정파일 생성가능합니다.

  • 설정내용

$> vi test.kr
# 원본 아파치 로그 경로설정
LogFile="/usr/local/apache2/logs/test.kr-access_log"

# 로그형태 설정
LogType=W
(웹로그=W, 메일로그=M, FTP전송로그=F)

# 로그포맷설정
LogFormat=1
(아파치로그=1, IIS로그=2)

# 사이트 메뉴에서 보일 도메인명
SiteDomain="test.kr"

# 호스트 별칭설정
HostAliases="awstats.test.kr"

# Awstats 로그 경로설정
DirData="/usr/local/awstats/logs"

# 자동업데이트 설정
EnableLockForUpdate=0
(자동업데이트=0, 수동업데이트=1)

  • 아파치 설정하기

  • *아파치 로그는 combined 형태로 저장되어 있어야 분석이 가능하며, common으로 되어 있을경우, 호환성 문제로 경고메시지 출력함.

  • 아파치 설정파일 샘플

CustomLog "logs/access_log" combined
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/"
AllowOverride all
Order allow,deny
Allow from all
Options ExecCGI

  • 레포트 출력하기 & Crontab에 추가하기

$> /usr/bin/perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=test.kr -update
$> crontab -l
* * * * * /usr/bin/perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=test.kr -update > /dev/null

출처 - http://igoni.kr/books/linux/page/awstat

댓글 없음:

댓글 쓰기

adfit

AI들끼리 대화하기

ChatGPT, perplexity, Gemini... 많은 AI 서비스가 있고 서비스별로 다양한 엔진이 있죠. 문득 AI끼리 대화를 시켜보면 어떤 대화의 흐름을 이어갈까 궁금해졌습니다. 그래서 해보았습니다. 규 칙 나(사람)은 양쪽 AI에서...