아파치 로그분석도구 Awstats 설치및 사용 > server

본문 바로가기
사이트 내 전체검색

server

아파치 로그분석도구 Awstats 설치및 사용

페이지 정보

작성자 서방님 댓글 0건 조회 146회 작성일 15-11-30 17:54

본문

출처 : http://help.cafe24.com/cs/cs_faq_view.php?idx=1593&page=1&mode=search&s_key=&s_period=&s_value=awstat&faq_list=0&categoryIdx=0&select_os=&contentNum=2


AWStats는 무료 공개 로그 분석 소프트웨로서 웹 로그, FTP 로그, 메일 로그 등을 분석할 수 있습니다.

웹 로그를 통해 어떤 지역, IP에서 어떤 페이지를 보고 얼마나 사이트에 머물렀으며 언제 왔는지 등을 확인할 수 있습니다.

 

1. 설치 파일 다운로드

[root@localhost src]# wget http://prdownloads.sourceforge.net/awstats/awstats-7.3.tar.gz

 

2. 압축해제

[root@localhost src]# tar zfvx awstats-7.3.tar.gz

 

3. awstats file copy

[root@localhost src]# cp -a awstats-7.3 /home/awstats

 

4. 권한설정

[root@localhost home]# chown -R root:root /home/awstats/

[root@localhost home]# chmod 755 /home/awstats

[root@localhost home]# mkdir -p /etc/awstats

[root@localhost home]# mkdir -p /var/lib/awstats

[root@localhost tools]# chmod 755  /home/awstats/tools/*.pl

 

5. awstats 환경설정

[root@localhost tools]# /home/awstats/tools/awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 20140126) (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

Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.

If you want to use standard directory, you should first move all content

of AWStats distribution from current directory:

/home/awstats

to standard directory:

/usr/local/awstats

And then, run configure.pl from this location.

Do you want to continue setup from this NON standard directory [yN] ? y

-----> Check for web server install

Enter full config file path of your Web server.

Example: /etc/httpd/httpd.conf

Example: /usr/local/apache2/conf/httpd.conf

Example: c:Program filesapache groupapacheconfhttpd.conf

Config file path ('none' to skip web server setup):

> 아파치 환경설정 파일 httpd.conf 파일위치 입력후 Enter

> /home/apache/conf/httpd.conf

-----> Check and complete web server config file '/home/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 "/home/awstats/wwwroot/classes/"'

  Add 'Alias /awstatscss "/home/awstats/wwwroot/css/"'

  Add 'Alias /awstatsicons "/home/awstats/wwwroot/icon/"'

  Add 'ScriptAlias /awstats/ "/home/awstats/wwwroot/cgi-bin/"'

  Add '<Directory>' directive

  AWStats directives added to Apache config file.

-----> Update model config file '/home/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:

> 로그분석할 사이트주소 입력

> localhost.cafe24.com


> awstats 설정파일 디폴트경로

-----> 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.localhost.cafe24.com.conf'

 Config file /etc/awstats/awstats.localhost.cafe24.com.conf created.

-----> Restart Web server with '/sbin/service httpd restart'

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.cafe24.com for ServerName

(98)Address already in use: make_sock: could not bind to address [::]:80

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

Unable to open logs

Stopping httpd:                                            [FAILED]

Starting httpd:                                            [FAILED]

-----> 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:

/home/awstats/wwwroot/cgi-bin/awstats.pl -update -config=localhost.cafe24.com

Or if you have several config files and prefer having only one command:

/home/awstats/tools/awstats_updateall.pl now

Press ENTER to continue...

A SIMPLE config file has been created: /etc/awstats/awstats.localhost.cafe24.com.conf

You should have a look inside to check and change manually main parameters.

You can then manually update your statistics for 'localhost.cafe24.com' with command:

> perl awstats.pl -update -config=localhost.cafe24.com

You can also read your statistics for 'localhost.cafe24.com' with URL:

> http://localhost/awstats/awstats.pl?config=localhost.cafe24.com

Press ENTER to finish...

 

6. 아파치 로그디렉토리 확인

[root@localhost tools]# ll /home/apache/logs

total 12

-rw-r--r-- 1 root root 158 Jul 11 14:07 access_log

-rw-r--r-- 1 root root 495 Jul 11 14:07 error_log

-rw-r--r-- 1 root root   4 Jul 11 14:07 httpd.pid

 

7. 아파치 로그파일위치 수정및 언어 설정

[root@localhost awstats]# vi /etc/awstats/awstats.localhost.cafe24.com.conf

로그파일 경로수정

수정전 : LogFile=/var/log/httpd/mylog.log"

수정후 : LogFile="/home/apache/logs/access_log"

언어설정

수정전 : Lang="auto"

수정후 : Lang="ko"

설정시 log 형태를 common -> combiend로 변경하여야합니다.

CustomLog "logs/access_log" combined

* awstats DB파일만들기

awstats DB파일을 만들때 /home/awstats 경로를 아래와 같이 추가해줘야합니다.

[root@localhost cgi-bin]# vi /home/awstats/wwwroot/cgi-bin/awstats.pl

     my @PossibleConfigDir = (

                        "$DIR",

                        "/etc/awstats",

                        "/home/awstats",

                        "/usr/local/etc/awstats", "/etc",

                        "/etc/opt/awstats"

 

8. 로그분석 awstats.pl 실행

[root@localhost cgi-bin]# /home/awstats/wwwroot/cgi-bin/awstats.pl -update -config=localhost.cafe24.com

Create/Update database for config "/etc/awstats/awstats.localhost.cafe24.com.conf" by AWStats version 7.3 (build 20140126)

From data in log file "/home/apache/logs/access_log"...

Phase 1 : First bypass old records, searching new record...

Searching new records from beginning of log file...

Jumped lines in file: 0

Parsed lines in file: 2

 Found 0 dropped records,

 Found 0 comments,

 Found 0 blank records,

 Found 2 corrupted records,

 Found 0 old records,

 Found 0 new qualified records.

 

9. 심볼릭 링크 생성

 

[root@localhost home]#  ln -sf /home/awstats /usr/local/awstats

 

10. crontab 등록 : crontab -e

 

0 0 * * * perl /home/awstats/tools/awstats_updateall.pl now -configdir=/etc/awstats

 

10. 웹페이지 접속

  http://domain.com/awstats/awstats.pl?config=domain.com

댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
90
어제
84
최대
1,347
전체
154,461
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.