B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-24 Tuesday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  Go Unix Power Tools Online Book Go Bash Guide
Read No. 48 article 2001-10-18 23:58:28
NickName   Ç®ºñ´©
Subject   domain.com/~abd -> abc.domain.com À¸·Î
mod_rewrite ¿Í Virtual User Hosts 
±Û¾´ÀÌ : ÀÌ¿î¾ï (2001³â 10¿ù 05ÀÏ ¿ÀÀü 11:24) ÀÐÀº¼ö: 348 
mod_rewrite ¿Í Virtual User Hosts 
================================= 

¿øÇÏ´Â °á°ú´Â "http://www.domain.com/~userid" ¸¦ »ç¿ëÄ¡ ¾Ê°í 
"http://userid.domain.com" À¸·Î ¼­ºñ½ºÇÒ ¸ñÀûÀÔ´Ï´Ù. 

Àß ¾ð±ÞµÈ ¹®¼­°¡ ÀÖ¾ú´ø °ÍÀ¸·Î »ý°¢Çߴµ¥, ÇÊ¿äÇؼ­ 
ãÀ¸·Á°í ÇÏ´Ï Èûµé´õ±º¿ä -_-; 
»ý°¢³­ Âü¿¡ °£´ÜÈ÷ Á¤¸®Çؼ­ ¿Ã¸³´Ï´Ù. 

°£´ÜÈ÷ 3´Ü°è·Î ³ª´­¼ö ÀÖ½À´Ï´Ù. 

1. ³×ÀÓ¼­¹ö ¼³Á¤ 
2. mod_rewrite ¸ðµâ žÀç 
3. httpd.conf ¿¡ rewrite °ü·Ã ¼³Á¤ 


1. ³×ÀÓ¼­¹ö ¼³Á¤ 
---------------- 

ÇØ´çÇÏ´Â zone ÆÄÀÏ¿¡¼­ È£½ºÆ® À̸§¿¡ "*" ¹®ÀÚ¸¦ »ç¿ëÇÕ´Ï´Ù. 

* IN A 111.2.333.4 


2. mod_rewrite ¸ðµâ žÀç 
------------------------ 

a) ¾ÆÆÄÄ¡ÀÇ ¸ðµâµéÀÌ ¼³Ä¡µÈ µð·ºÅ丮¿¡ mod_rewrite.so °¡ Á¸ÀçÇÒ °æ¿ì. 

c) ·Î °Ç³Ê ¶ç¸é µË´Ï´Ù ^^; 

b) ¾ÆÆÄÄ¡ÀÇ ¸ðµâµéÀÌ ¼³Ä¡µÈ µð·ºÅ丮¿¡ mod_rewrite.so °¡ ¾ø´Â °æ¿ì. 

apache ¸¦ ´Ù½Ã ÄÄÆÄÀÏ ÇÕ´Ï´Ù. 

env CFLAGS="-DEAPI" \ 
./configure \ 
--prefix=/etc/httpd \ 
--enable-module=so \ 
--enable-shared=max \ 
--enable-module=rewrite \ 
--enable-shared=rewrite 


make 
make install 

c) httpd.conf ¿¡¼­ ´ÙÀ½À» È®ÀÎÇÕ´Ï´Ù. 

LoadModule rewrite_module libexec/mod_rewrite.so 
AddModule mod_rewrite.c 


3. httpd.conf ¿¡ rewrite °ü·Ã ¼³Á¤ 
---------------------------------- 


<VirtualHost *> 
ServerAdmin admin at domain.com 
DocumentRoot /home/httpd/html 
ServerName www.domain.com 
ServerAlias domain.com *.domain.com 
ErrorLog logs/domain.com-error_log 
CustomLog logs/domain.com-access_log common 

### Virtual User Hosts 

RewriteEngine on 

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ 
RewriteCond %{HTTP_HOST} !^domain\.com$ 
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$ 
RewriteRule ^(.+) %{HTTP_HOST}$1 [C] 
RewriteRule ^([^.]+)\.domain\.com(.*) /home/$1/html$2 
</VirtualHost>
Regist Addr [ 192.168.0.2 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.02 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®