Server & OS

우분투 awstats 설치하기

페이지 정보

본문

출처 : http://blog.naver.com/youngchanmm/220970634295


1. awstats 설치

$ sudo apt-get install awstats 

위 명령어를 치면 설치가 되고 디렉토리가 여러개 생김

/etc/awstats/ : 설정파일 루트 디렉토리

/var/lib/awstats/ : 분석이 끝난 자료를 정리해둔 파일

/etc/cron.d/awstats : cron job 에 등록될 내용이 저장되어 있다.

/usr/lib/cgi-bin/awstats.pl : 실제 실행 파일(cron 에서 매일 실행하거나, 웹에서 보여줄때 모두 사용된다.)

 

2. awstats 설정

도메인이 있는 경우에는 별도로 설정 파일을 생성하고 해야되지만 일단 localhost 기준으로...

$ sudo vi /etc/awstats/awstats.conf

SiteDomain="localhost"

Lang="ko"


3. 로그파일 업데이트

$sudo /usr/lib/cgi-bin/awstats.pl -config=localhost -update

 

4. 아파치 설정

$sudo vi /etc/apache2/conf-enabled/awstats.conf

Alias /awstatsclasses "/usr/share/awstats/lib/" 

Alias /awstats-icon/ "/usr/share/awstats/icon/" 

Alias /awstatscss "/usr/share/doc/awstats/examples/css" 

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 

ScriptAlias /awstats/ /usr/lib/cgi-bin/ 

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

 

$sudo vi /etc/apache2/apache2.conf

<Directory /usr/lib/cgi-bin>

        Options ExecCGI MultiViews SymLinksIfOwnerMatch FollowSymLinks

        AllowOverride All

        Require all granted

        SetHandler cgi-script

</Directory>

위에 소스를 맨 밑에 추가한다

 

5. cgi 활성화

$ sudo a2enmod cgi

 

6. 아파치 재시작

$ sudo /etc/init.d/apache2 restart

 

7. crontab 등록

0 0/3 * * * www-data /usr/lib/cgi-bin/awstats.pl -config=localhost -update > /dev/null

 

 

 

관련자료

등록된 댓글이 없습니다.
Today's proverb
한가지 변함없는 법칙이 있다. 우리가 깊은 상처를 입었을 때, 용서하지 않는 한은 어떤 치유도 없다는 것이다. (알란 패턴)