메뉴 건너뛰기

조회 수 10147 추천 수 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
번호 제목 날짜 조회 수
116 CentOS 7 에 php 설치하기 2015.07.16 7663
115 CentOS 7 에 아파치(httpd) 설치 2015.07.16 10300
114 아파치 설치 2015.07.16 7864
113 시스템 보안점검 명령어들 file 2015.07.08 9372
112 리눅스 계정 파일 위치 file 2015.07.01 8117
111 hp Smart Array CLI 사용해서 논리드라이브 복구(Linux) 2015.06.16 9050
110 fdisk로 파티션 삭제하기 2015.06.10 25786
109 sulinux2.0 NFS 설정 & 공유 2015.06.10 7943
108 리눅스 마운트 (mount)를 해보자 file 2015.06.09 8529
107 리눅스 파티션(partition)을 나눠보자 file 2015.06.09 8438
106 fdisk로 파티션 삭제하기 2015.06.09 21721
105 리눅스,사용자계정(관련 파일,명령어) file 2014.10.30 7624
104 리눅스 기본보안설정(13) file 2014.05.15 7297
103 리눅스 기본보안설정(12) file 2014.05.15 7900
102 리눅스 기본보안설정(11) file 2014.05.15 8346
101 리눅스 기본보안설정(10) file 2014.05.15 7742
100 리눅스 기본보안설정(9) file 2014.05.15 7507
99 리눅스 기본보안설정(1-8) 2014.05.15 7630
98 문자셋 설정, charset 2014.04.29 7480
97 find - 파일 검색 2014.04.29 7200
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 Next
/ 12

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved