본문 바로가기
[IT 관련 지식]/[Linux]

우분투 cband 설치방법

by 판톰 2012. 7. 3.
반응형

cband


고객별 트레픽 사용량 제한하기 위한

설치전 apt-get install make

wget http://fossies.org/unix/www/apache_httpd_modules/mod-cband-0.9.7.5.tgz

 

Scp 파일 리눅스 서버로 복사

mv mod-cband-0.9.6.1.tgz /usr/local/src/

Cd /usr/local/src/

mod-cband-0.9.6.1.tgz

tar zxvf mod-cband-0.9.6.1.tgz  [파일 압축풀기]

cd mod-cband-0.9.6.1/            [경로이동]

 

[Makefile 수정]

root@ubuntu:/usr/local/src/mod-cband-0.9.7.5# vi Makefile.in

 

#

# $Id: Makefile.in,v 1.4 2005/10/07 11:54:40 dembol Exp $

#

# mod_cband - A per-user, per-virtualhost and per-destination bandwidth limiter for the Apache HTTP Server Version 2

#

# Copyright (c) 2005 Lukasz Dembinski <dembol@cband.linux.pl>

#

# This program is free software; you can redistribute it and/or modify

# it under the terms of the GNU General Public License as published by

# the Free Software Foundation; either version 2 of the License, or

# (at your option) any later version.

#          

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

# GNU General Public License for more details.

#                          

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#

 

APXS=@APXS@

APXS_OPTS=-lm -Wc,-Wall -Wc,-DDST_CLASS=3      [수정]

SRC=src/mod_cband.c

OBJ=src/.libs/mod_cband.so

 

$(OBJ): $(SRC)

        @echo

        $(APXS) $(APXS_OPTS) -c $(SRC)

        @echo

        @echo write '"make install"' to install module

        @echo

 

install: $(OBJ)

        $(APXS) $(APXS_OPTS) -i -a -n cband src/mod_cband.la

 

clean:

        rm -f src/.libs/*

        rm -f src/*.o

        rm -f src/*.lo

        rm -f src/*.la

        rm -f src/*.slo

        rmdir src/.libs

~                           

 root@ubuntu:/home/mod-cband-0.9.6.1#./configure --with-apxs=/usr/bin/apxs2

 make

 make install

  vi /etc/apache2/mods-enabled/cband.load

  cd /etc/apache2/mods-available/

 

  vi cband.conf    [ 생성]

<IfModule mod_cband.c>

<Location /cband-status>

   SetHandler cband-status

   AuthName "트래픽 관리 페이지"

   AuthType Basic

   AuthUserFile /home/.htpasswd

   require valid-user

</Location>

<Location /cband-status-me>

   SetHandler cband-status-me

   Order deny,allow

   Deny from all

   Allow from all

</Location>

</IfModule>

 

 

cd mods-enabled/

ln -s ../mods-available/cband.conf ./

ln -s ../mods-available/rewrite.load ./

htpasswd -c /home/.htpasswd admin  [cband패이지 admin 관리자 생성및 패스워드 지정

/etc/init.d/apache2 restart

[확인 서버IP/cband-status    접속하면 로그인창에  admin   - 설정한 관리자 패스워드로 접속하면 아래와 같은 화면이 출력되어집니다.



 

vi /var/www/error.php [생성]

Traffic over!

반응형