트래픽 제어 모듈인 mod_cband 를 설치 해 보자

mod_cband_status.png

1. 설치방법
  cd /usr/local/src
  wget http://cband.linux.pl/download/mod-cband-0.9.7.5.tgz
  tar xvfpz mod-cband-0.9.7.5.tgz
  cd mod-cband-0.9.7.5
  ./configure --with-apxs=/usr/local/apache/bin/apxs
  ## 옵션설명
  ## --with-apxs=/usr/local/apache/bin/apxs : 아파치 apxs경로를 찾아서 지정합니다.
  make
  make install

 

2. 설치확인
  - httpd.conf 파일에
     LoadModule cband_module       modules/mod_cband.so
   줄이 추가된것을 볼 수 있습니다.
  - 아파치/modules 디렉토리에
      mod_cband.so
    파일이 추가 된 것을 볼수 있습니다.


3. 기본 설정

====================================
  <Location /cband-status>
     SetHandler cband-status
     Order deny,allow
     Deny from all
     Allow from 열어줄아이피
  </Location>

  <Location /cband-status-me>
    SetHandler cband-status-me
  </Location>

<VirtualHost *>
   ServerName xxxxxx.co.kr   
   Document /home/xxxxxx/public_html
    CBandLimit 300Mi
   CBandPeriod 1D
   CBandExceededURL http://nanoomi.org/traffic_exceeded.html
</VirtualHost>
======================================
위 설정파일은 xxxxxx.co.kr 도메인에
하루에 300M(300*1024*1024byte)의 트래픽을 제공하는 설정입니다.
bit로 따지면, 2.4Gbit/일 트래픽을 제공하는 것입니다.
만약 하루에 300M를 초과했다면, "http://nanoomi.org/traffic_exceeded.html"
를 만들어 두면 해당 페이지가 뜨며, 지정하지 않았다면, 503 에러 페이지가 뜨게됩니다.
트래픽 제한을 하지 않고 관찰만 하려 한다면, CBandPeriod 부분만 남기고 삭제합니다. 

 

출처 : http://www.nanoomi.org/bbs/board.php?bo_table=03_2&wr_id=29

첨부파일

mod_cband_status.png (76.5 KB)
0회 2015-11-13 13:12
|

댓글 2개

하루 지나고 자동으로 refresh 가 안되어 crontab 에 아래 설정 걸어 두어서 사용하고 있습니다.

"http://xxx.xxx/cband-status?reset=all&refresh=15&unit="
서버 관리자들은 대부분 crontab을 사용해서 관리 할겁니다...^^
댓글을 작성하시려면 로그인이 필요합니다.

서버관리자

서버관리자 모임 게시판 입니다.

+
제목 글쓴이 날짜 조회
10년 전 조회 2,574
10년 전 조회 2,628
10년 전 조회 2,366
10년 전 조회 2,710
10년 전 조회 1,736
10년 전 조회 3,085
10년 전 조회 1,837
10년 전 조회 2,102
10년 전 조회 4,194
10년 전 조회 1,381
10년 전 조회 2,480
10년 전 조회 1,868
10년 전 조회 1,971
10년 전 조회 2,332
10년 전 조회 4,272
10년 전 조회 1,998
10년 전 조회 2,067
10년 전 조회 1,787
10년 전 조회 3,907
10년 전 조회 2,594
10년 전 조회 6,394
10년 전 조회 2,731
10년 전 조회 2,880
10년 전 조회 2,114
10년 전 조회 2,556
10년 전 조회 2,082
10년 전 조회 3,168
10년 전 조회 1,735
10년 전 조회 2,249
10년 전 조회 4,092