메뉴 건너뛰기

조회 수 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 26Mar
    by
    2021/03/26 Views 76653 

    split 명령어 (파일 나누기)

  2. No Image 28Mar
    by
    2018/03/28 Views 69696 

    [CentOS 7] SSH 무작위 로그인 시도 막기 ( Fail2Ban )

  3. tomcat - server.xml 설정

  4. No Image 28Apr
    by
    2017/04/28 Views 27358 

    리눅스서버 모니터링 rstatd 설치

  5. No Image 10Jun
    by
    2015/06/10 Views 26023 

    fdisk로 파티션 삭제하기

  6. No Image 09Jun
    by
    2015/06/09 Views 21723 

    fdisk로 파티션 삭제하기

  7. CentOS6.6+httpd2.4.16+Mariadb10.0.20+php5.6.11 Source 설치....

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

    bash 스크립트에서 네트워크 정보 확인하기

  9. No Image 27Feb
    by
    2014/02/27 Views 12307 

    원격 접속 FreeNX (NOMACHINE) 설치/접속 (vnc 보다 훨

  10. No Image 22Jul
    by
    2016/07/22 Views 12175 

    리눅스 읽기전용 파일시스템 / 파일 입/출력 오류

  11. Centos7 64bit 웹서버 만들기-PHP설치 CAP5

  12. No Image 18Mar
    by
    2016/03/18 Views 10744 

    php-5.2.17 make시에 오류 발생 make: *** [ext/dom/node.lo] 오류 1

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

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

  14. No Image 16Jul
    by
    2015/07/16 Views 10302 

    CentOS 7 에 아파치(httpd) 설치

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

    웹서버 모니터링 툴 awststs

  16. No Image 27Feb
    by
    2014/02/27 Views 9616 

    파일 속성 명령어 : chattr, lsattr

  17. No Image 18Mar
    by
    2016/03/18 Views 9575 

    libphp5.so: undefined symbol: unixd_config

  18. No Image 27Feb
    by
    2014/02/27 Views 9555 

    iptable에서 TCP SYN Flooding 차단 설정

  19. [CentOS 6.5] Tomcat 설치 및 구동

  20. MySQL Linux Port 방화벽 설정(3306)

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

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved