메뉴 건너뛰기

조회 수 10262 추천 수 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 //추가
#

  1. No Image 18Mar
    by
    2016/03/18 Views 9316 

    확장자가 없는 파일 자동인식하는 mod_mime_magic

  2. No Image 28Apr
    by
    2017/04/28 Views 8042 

    하루동안 실행된 쿼리 중 수행시간이 가장 긴 조회 쿼리 100개

  3. No Image 27Feb
    by
    2014/02/27 Views 7471 

    하드디스크의 속도와 성능테스트강좌 hdparm

  4. No Image 18Mar
    by
    2016/03/18 Views 8808 

    하드디스크 배드블록 점검 툴 - badblocks

  5. No Image 18Apr
    by
    2017/04/18 Views 9043 

    포그라운드, 백그라운드, nohup 정리

  6. No Image 27Feb
    by
    2014/02/27 Views 9617 

    파일 속성 명령어 : chattr, lsattr

  7. No Image 18Mar
    by
    2016/03/18 Views 7553 

    특정 웹페이지에서 문자가 깨지는 경우 (인코딩 문제)

  8. No Image 27Feb
    by
    2014/02/27 Views 8051 

    특정 데몬의 메모리 점유율 확인하기

  9. No Image 18Mar
    by
    2016/03/18 Views 7632 

    컴파일을 이용하여 Apache 최신버전을 설치하자

  10. No Image 26Mar
    by
    2021/03/26 Views 179 

    재지향시 유의사항 (grep 재지향)

  11. 작업 예약 스케줄러(크론Cron)파일,자동 백업 명령

  12. 인코딩 깨진한글파일 삭제 방법

  13. No Image 18Mar
    by
    2016/03/18 Views 10391 

    이온큐브로더(ioncube) 설치 매뉴얼

  14. No Image 14Feb
    by
    2019/02/14 Views 1137 

    이미지 및 파일 무단링크 방지책

  15. 웹호스팅용 리눅스 서버 셋팅

  16. 웹호스팅용 리눅스 서버 셋팅

  17. No Image 20Sep
    by
    2017/09/20 Views 5530 

    웹서버(Nginx+FastCGI PHP)구축 및 성능 시험

  18. No Image 26Mar
    by 조쉬
    2014/03/26 Views 10262 

    웹서버 모니터링 툴 awststs

  19. No Image 28Apr
    by
    2017/04/28 Views 8465 

    웹로직 서버 시작 및 종료 스크립트

  20. No Image 13Apr
    by
    2017/04/13 Views 8685 

    웹로직 + 아파치 연동

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved