메뉴 건너뛰기

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

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
참조 : http://awstats.sourceforge.net
###########Trouble Shooting############
awstats가 정상적으로 동작하기 위해서는 perl script가 필요하며,
apache에 perl module을 올리던지 아니면 아래에 경로의 pl 소스에서 perl이 설치된 경로를 수정해준다.
a) /usr/local/awstats/wwwroot/cgi-bin
b) /usr/local/awstats/wwwroot/cgi-bin/lib
c) /usr/local/awstats/wwwroot/cgi-bin/plugins
펄 설치 됐나?? -- 확인
[root@ns wwwroot]# find / -name perl -print
/usr/bin/perl
[root@ns wwwroot]#
#####################################
[root@ns sausage]# tar xvfz awstats-6.5.tar.gz
[root@ns sausage]# mv awstats-6.5 /usr/local/awstats
[root@ns sausage]# chmod 755 /usr/local/awstats -R
[root@ns sausage]# mkdir /etc/awstats
[root@ns sausage]# mkdir /var/lib/awstats
[root@ns sausage]# cd /usr/local/awstats/tools/
[root@ns tools]# perl awstats_configure.pl
----- AWStats awstats_configure 1.0 (build 1.6) (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 '<Directory>' 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.suhilelec.co.kr
-----> 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.suhilelec.co.kr.conf'
Config file /etc/awstats/awstats.www.suhilelec.co.kr.conf created.
-----> Restart Web server with '/sbin/service httpd restart'
httpd: unrecognized service
-----> 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.suhilelec.co.kr
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.suhilelec.co.kr.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.suhilelec.co.kr' with command:
> perl awstats.pl -update -config=www.suhilelec.co.kr
You can also read your statistics for 'www.suhilelec.co.kr' with URL:
> http://localhost/awstats/awstats.pl?config=www.suhilelec.co.kr
Press ENTER to finish...
---------------- 일단 설치 완료 / 설정 시작 -----------------
configure.pl 을 잘 실행 시켰으면 자신이 정한 name으로
awstats.[정한 name].conf 파일이 /etc/awstats디렉토리 아래로 생성되어 있을겁니다.
(우리는 awstats.www.suhilelec.co.kr.conf )
# vi /etc/awstats/awstats.www.suhilelec.co.kr.conf
....수정
LogFile="[자신이 사용하는 웹서버의 access 로그]"
우리는
LogFile="/usr/local/apache/log/new-access_log"
를 지정하시면 됩니다.
[root@ns cgi-bin]# pwd
/usr/local/awstats/wwwroot/cgi-bin
[root@ns cgi-bin]# perl awstats.pl -update -config=www.suhilelec.co.kr
.
.
.
. 오류난다...
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
222.97.239.121 - - [01/Apr/2006:00:05:20 +0900] "GET /images/factory/03_p01_03.gif HTTP/1.1" 200 19940
Setup ('/etc/awstats/awstats.www.suhilelec.co.kr.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

오류 타입이 틀려서 오류나니까 다시 수정

[root@ns wwwroot]#vi /etc/awstats/awstats.www.suhilelec.co.kr.conf (로그 Format 수정하기)
.
.
.
LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd
.
.
.
[root@ns wwwroot]# /usr/local/awstats/tools/awstats_updateall.pl now
Running '"/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -update -config=www.suhilelec.co.kr -configdir="/etc/awstats"' to update config www.suhilelec.co.kr
Update for config "/etc/awstats/awstats.www.suhilelec.co.kr.conf"
With data in log file "/usr/local/apache/logs/new-access_log.200604"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 67480
Found 29 dropped records,
Found 13 corrupted records,
Found 0 old records,
Found 67438 new qualified records.
[root@ns wwwroot]#
성공한듯.....!!!!!!!!!!!!!!!!!!

-----------------------로그 누락없이 로테이트 돌리기 추가 -----------------------
# vi /etc/logrotate.d/apache
/usr/local/apache/logs/*log
{
notifempty
daily
rotate 7
compress
sharedscripts
prerotate
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mydomainconfig
endscript
postrotate
/usr/bin/killall -HUP httpd
endscript
}
#
--------------------- 크론으로 자동 업데이트 하루한번 6시에.. ---------------------
# vi /etc/crontab
.
.
.
00 6 * * * root /usr/local/awstats/tools/awstats_updateall.pl now > /dev/null //추가
#

List of Articles
번호 제목 날짜 조회 수
97 리눅스 yum 명령어 2016.09.11 7993
96 솔라리스 10 (Telnet/FTP/SSH) 설정 2017.02.03 7995
95 mysql DB 지정 백업 스크립트 2016.03.18 8004
94 백업받기 2016.09.12 8010
93 외부에서 apache 정보 못보도록 설정하기 2014.02.27 8013
92 리눅스서버 시간 한국 시간(한국표준시;KST)으로 변경 2014.03.26 8019
91 하루동안 실행된 쿼리 중 수행시간이 가장 긴 조회 쿼리 100개 2017.04.28 8042
90 특정 데몬의 메모리 점유율 확인하기 2014.02.27 8051
89 PHPIZE를 이용한 openSSL PHP 확장 모듈 설치 2016.09.11 8065
88 APM 소스 설치 2014.02.27 8068
87 Apache 웹서버 server-status 모니터링 2014.02.27 8074
86 Yum과 rpm을 이용하여 PHP5.5버전 설치 2016.03.18 8075
85 아파치 디렉토리 보이는 것 막기 file 2017.02.02 8076
84 ftp passive mode 설정 2014.02.27 8095
83 리눅스 부팅 과정과 커널 패닉 조치요령 2014.02.27 8108
82 리눅스 계정 파일 위치 file 2015.07.01 8117
81 Apache 리다이렉트 2016.03.18 8155
80 apache 컴파일시 동시 접속자 제한 변경하기 2014.03.26 8157
79 [Linux]리눅스,사용자계정(관련 파일,명령어) file 2015.11.21 8159
78 아파치 재시작 없이 설정 적용 2015.07.16 8184
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved