달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

샘플


<VirtualHost 218.236.58.88> 
    ServerAdmin *** 개인정보보호를 위한 이메일주소 노출방지 ***     // 관리자 이메일 
    DocumentRoot /home/test/www                           // 기본 웹 루트        
    ServerName  test.com                                       // 기본서버명 
    ServerAlias *.test.com                                       // 모든 서브도메인을 Alias로 받습니다.
     RewriteEngine on                                           // RewriteEngine 활성화
     RewriteCond  %{HTTP_HOST}   ^[^.]+\.test\.com$   // 서버명에 서브도메인 정규화로 매치 
     RewriteRule  ^(.+)   %{HTTP_HOST}$1 [C]     // Cond에 해당되는 도메인에 대해서 도메인뒤에 나온 문장 매치
     RewriteRule  ^([^.]+)\.test\.com(.*) /home/test/$1/$2    서브도메인과 해당페이지 매치 
    ErrorDocument 404 /home/test/error/err-404.html 
    ErrorDocument 403 /home/test/error/err-403.html 
    ErrorLog /home/test/web_log/error_log 
    CustomLog /home/test/web_log/access_log common 
</VirtualHost>


출처 : http://sir.kr/pg_tip/14836?sfl=wr_subject%7C%7Cwr_content&stx=DNS


-- 정리 한 내용


#가상 호스트 샘플 a.com,  b.com   root 경로 www 폴더안에 생성 

#<VirtualHost *:80>

#    ServerAdmin webmaster@test.com

#    DocumentRoot "C:/xampp/htdocs"

#    ServerAlias *.com

#     RewriteEngine on

#     RewriteCond  %{HTTP_HOST} ^[^.]+\.com$

#     RewriteRule  ^(.+) %{HTTP_HOST}$1 [C]

#     RewriteRule  ^([^.]+)\.com(.*) C:/xampp/htdocs/$1/$2

#    ErrorLog "logs/web_log.log"

#    CustomLog "logs/web_log.log" common

#</VirtualHost>


#가상 호스트 샘플 a.test.comm b.test.com   root 경로 www 폴더안에 생성 

#<VirtualHost *:80>

#    ServerAdmin webmaster@test.com

#    DocumentRoot "C:/xampp/htdocs/www"

#    ServerName test.com

#    ServerAlias *.test.com

#     RewriteEngine on

#     RewriteCond  %{HTTP_HOST} ^[^.]+\.test\.com$

#     RewriteRule  ^(.+) %{HTTP_HOST}$1 [C]

#     RewriteRule  ^([^.]+)\.test\.com(.*) C:/xampp/htdocs/www/$1/$2

#    ErrorLog "logs/web_log.log"

#    CustomLog "logs/web_log.log" common

#</VirtualHost>



Posted by 타카스 류지
|