RadarURL

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

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

[리눅스] webalizer를 통한 apache log(웹서버 접속 통계) 분석하기

OS : CentOS 5.4

UTIL : Webalizer Version 2.21

 

1. 설치하기

yum -y install GeoIP-data GeoIP-devel GeoIP # 국가별 로그 남기기 (GeoIP 설치)
yum -y install webalizer (주의 : 영문으로 컴파일되어 있음)

- http://www.mrunix.net/webalizer/download.html 에서 소스를 다운로드 받는다.

wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.21-02-src.tar.bz2

bzcat webalizer-2.21-02-src.tar.bz2 | tar xvf -

cd webalizer-2.21-02

./configure --prefix=/usr/local/webalizer \
--with-language=korean \
--with-pnglib=/usr/lib \
--with-gdlib=/usr/lib \
--with-gd=/usr/include \
--enable-geoip \
--with-geoip=/usr/include \
--with-geoiplib=/usr/lib \

--enable-flags

 

make

mv /usr/bin/webalizer /usr/bin/webalizer.org

cp webalizer /usr/bin/webalizer (한글판으로 대체하기)

 

2. 가상호스트 서버에 대한 설정하기
   - 먼저 /etc/httpd/conf/httpd.conf 에서 VirtualHost설정 내역과 일치하여야 한다.
mkdir -p /etc/webalizer/conf
cd /etc/webalizer/conf
vi exam.conf (exam 은 자신의 가상호스트명을 사용하면 된다)
---------------------------------------------------------
LogFile /var/log/httpd/exam.domain.net-access_log
OutputDir /var/www/usage/exam
HistoryName /var/www/usage/exam/webalizer.hist
ReportTitle    사용량 통계 :
HostName       exam.domain.net
Incremental yes
IncrementalName /var/www/usage/exam
/webalizer.current

GeoIP yes
GeoIPDatabase  /var/lib/GeoIP/GeoIP.dat

CountryFlags   yes
FlagDir    flags

---------------------------------------------------------
 

3. 분석결과 저장 디렉토리 만들기
mkdir -p /var/www/usage/exam # OutputDir 만들기

4. 하루에 한번씩 수행되게 하기 (crond)
    - 파일명이 왜 00webalizer냐면, logrotate 보다 먼저 실행시키기 위함이다
vi /etc/cron.daily/00webalizer
----------------------------------------

# VirtualHost들에 대한 접속통계
for f in `ls /etc/webalizer/conf/*.conf`
do
   /usr/bin/webalizer -c $f
done

----------------------------------------

 

5. Apache에 mod_geoip 설치하기 (DSO 방식)

wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz

 

zcat mod_geoip2_1.2.5.tar.gz | tar xvf -
cd mod_geoip2_1.2.5
/usr/sbin/apxs -a -i -L/var/lib -I/usr/include -lGeoIP -c mod_geoip.c

 

6. 아파치 GeoIP 설정하기

/etc/httpd/conf/httpd.conf 설정

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i %{GEOIP_COUNTRY_CODE}e" common
<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /var/lib/GeoIP/GeoIP.dat
< /IfModule>

 

7. 아파치 재시동

/sbin/service httpd restart

 

8. 국가별 국기(아이콘) 설치하기

mkdir /var/www/usage/flags

cd /var/www/usage/flags

wget http://flags.blogpotato.de/zip/small/world.zip

unzip world.zip

cd /var/www/usage/exam

ln -s ../flags ./

 

9. 분석 결과 만들기

for f in `ls /etc/webalizer/conf/*.conf` ;  do  /usr/bin/webalizer -c $f ; done


10. 수행결과 (예제)

http://usage.inmu.net/ezsimple/


출처 : http://ezsimple.inmu.net/zb/view.php?id=free&no=572

?

공부 게시판

공부에 도움되는 글을 올려주세요.

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views2014801
    read more
  2. 손목터널증후군 치료, 현명한 선택 기준은?

    Date2026.10.05 Category웹서버,WAS By괴상한두루미52 Views1
    Read More
  3. 카­톡 gusim8003 급전/내구제 (24시문의) 선불폰 소액결제 일수 급전대출

    Date2026.10.05 Category웹서버,WAS By황금빛섬광82 Views2
    Read More
  4. 탄현동노래방 탄현동에서 찾는 노래방 010 2817 0845

    Date2026.10.03 Category웹서버,WAS By울리는고래상어65 Views16
    Read More
  5. 일반적인 Htaccess 301 리디렉션 규칙

    Date2026.04.01 Category웹서버,WAS ByYooN Views4186
    Read More
  6. [Windows] OWASP ZAP 사용법

    Date2025.09.29 Category웹서버,WAS ByYooN Views3889
    Read More
  7. [웹 취약점] 웹서버 디렉토리 리스팅 방지

    Date2025.09.29 Category웹서버,WAS ByYooN Views3498
    Read More
  8. [apache] HTTP/HTTPS 리다이렉트(Redirect/Rewrite) 하는 방법

    Date2025.09.11 Category웹서버,WAS ByYooN Views3539
    Read More
  9. http를 https로 리다이렉트하는 여러가지 방법

    Date2025.09.10 Category웹서버,WAS ByYooN Views3244
    Read More
  10. SSL인증서 없이 HTTPS에서 HTTP로 되돌리기

    Date2025.09.10 Category웹서버,WAS ByYooN Views3433
    Read More
  11. [SSL] win-acme, Let's encrypt로 무료 SSL 인증서 발급

    Date2025.09.10 Category웹서버,WAS ByYooN Views3829
    Read More
  12. [SSL] Windows 10에서 Let's Encrypt로 SSL 인증서 무료 발급받기

    Date2025.09.10 Category웹서버,WAS ByYooN Views3354
    Read More
  13. 무료로 https SSL/TLS 인증서를 발급받을 수 있는 인증 기관

    Date2025.09.10 Category웹서버,WAS ByYooN Views3442
    Read More
  14. 아파치 서버에 https SSL 인증서 적용하는 방법 (apache httpd)

    Date2025.09.10 Category웹서버,WAS ByYooN Views3165
    Read More
  15. 아파치2(Apache2) SSL HTTPS 적용하기

    Date2025.09.10 Category웹서버,WAS ByYooN Views3431
    Read More
  16. 아파치 웹서버에 멀티 도메인에 대한 80, 443 포트 설정하는 방법

    Date2025.09.10 Category웹서버,WAS ByYooN Views3329
    Read More
  17. 용량 산정 (동시 접속자 계산)

    Date2016.05.05 Category웹서버,WAS ByYooN Views5154
    Read More
  18. 아파치 httpd.conf 재시작 없이 설정 적용하기

    Date2016.05.02 Category웹서버,WAS ByYooN Views4897
    Read More
  19. Tomcat JVM heap memory set 및 size

    Date2016.03.23 Category웹서버,WAS ByYooN Views5404
    Read More
  20. Java 실행 옵션 정리

    Date2016.03.23 Category웹서버,WAS ByYooN Views4619
    Read More
  21. [JAVA] 개발환경설정 - 표준프레임워크

    Date2016.01.02 Category웹서버,WAS ByYooN Views5266
    Read More
Board Pagination Prev 1 2 3 Next
/ 3


즐겨찾기 (가족)

JAESOO's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너