YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > Linux
검색
멤버이름    오토
비밀번호 
 

DSO 로 설치한 apache 에서 mod_rewrite 적재와 1차 2차도메인의 트래픽통합 관리 방법

페이지 정보

작성자 MintState 댓글 0건 조회 16,162회 작성일 09-01-05 11:48

본문

DSO 로 설치한 apache 에서 mod_rewrite 적재와 1차 2차도메인의 트래픽통합 관리 방법 
 
정상적으로 웹서비스를 하고 있는 서버에서 mod_rewrite 적재를 통한 1차 도메인과 2차 도메인을 묶어 트래픽을 관리하기 위한 것임을 밝혀둡니다.
예를 들어 fox.co.kr 이라는 도메인에 2차도메인 demo.fox.co.kr 을 부여했을때, 하루 트래픽을 fox.co.kr 과 demo.fox.co.kr 에 따로 따로 부여하지 않고, 같이 묶어 트래픽이 운영자가 정한 수치를 넘지 못하게 하기 위한 것입니다.
====================================================================
* /usr/local/apache/가 아파치가 운용되고 있는 디렉토리라 가정하며 mod_rewrite 가 libexec 디렉토리 내에 존재하지 않을때를 기준으로 합니다.

1. mod_rewrite 적재

아파치원본화일 디렉토리에서
# ./configure --enable-module=rewrite
# cd src/modules/standard
# gcc -shared -o mod_rewrite.so mod_rewrite.o
# cp mod_rewrite.so /usr/local/apache/libexec/

2. httpd.conf 화일 설정

LoadModule rewrite_module    libexec/mod_rewrite.so <==추가
AddModule mod_rewrite.c <==추가

<VirtualHost 210.118.169.102>
ServerAdmin fox@fox.co.kr
DocumentRoot /home/fox.co.kr/html
ServerName www.fox.co.kr
ServerAlias fox.co.kr *.fox.co.kr
CustomLog /usr/local/apache/logs/access_log-fox.co.kr combined
ReWriteEngine on
RewriteCond %{HTTP_HOST} !^www.fox.co.kr$
RewriteCond %{HTTP_HOST} !^fox.co.kr$
RewriteCond %{HTTP_HOST} ^[^.]+.fox.co.kr$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).fox.co.kr(.*) /home/$1/html$2
ThrottlePolicy Volume 500M 1d
</VirtualHost>

===============================================================
2. 위와 같이 설정하고 /var/named/fox.zone 화일내에 demo 라는 2차 도메인을 추가

3. /home/demo/html 이라는 디렉토리생성
/home/demo/html/디렉토리내에 index.html 화일생성
# vi index.html
http://demo.fox.co.kr

4. 네임서버와 아파치 재시작
# /etc/rc.d/init.d/named restart
# /usr/local/apache/bin/apachectl restart

5. 웹브라우져를 열고 http://demo.fox.co.k 을 쳐서 확인...

6 . http://fox.co.kr/throttle-status 를 쳐서 트래픽확인

댓글목록

등록된 댓글이 없습니다.

Total 360건 3 페이지
Linux 목록
번호 제목 글쓴이 조회 날짜
320 MintState 17830 01-05
319 MintState 22642 01-05
318 MintState 19276 01-05
317 MintState 17686 01-05
316 MintState 25745 01-05
315 MintState 21261 01-05
314 MintState 17374 01-05
313 MintState 14627 01-05
312 MintState 17144 01-05
311 MintState 17321 01-05
310 MintState 18869 01-05
309 MintState 16870 01-05
308 MintState 38826 01-05
307 MintState 16155 01-05
열람중 MintState 16163 01-05
305 MintState 18057 01-05
304 MintState 11808 01-05
303 MintState 10469 01-05
302 MintState 18119 01-05
301 MintState 16164 01-05
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™