• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Mass Virtual Hosting 到底怎么實現???捆饒已久

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    MassVirtualHosting Description: TheVirtualHostfeatureofApacheisniceandworksgreatwhenyoujusthaveafewdozensvirtualhosts.ButwhenyouareanISPandhavehundredsofvirtualhoststoprovidethisfeatureisnotthebestchoice. Solution: Toprovidethisfeaturewema

    Mass Virtual Hosting
    Description: 
    The <VirtualHost> feature of Apache is nice and works great when you just have a few dozens virtual hosts. But when you are an ISP and have hundreds of virtual hosts to provide this feature is not the best choice. 
    Solution: 
    To provide this feature we map the remote webpage or even the complete remote webarea to our namespace by the use of the Proxy Throughput feature (flag [P]): ##
    ##  vhost.map 
    ## 
    www.vhost1.dom:80  /path/to/docroot/vhost1
    www.vhost2.dom:80  /path/to/docroot/vhost2
         :
    www.vhostN.dom:80  /path/to/docroot/vhostN
     
    ##
    ##  httpd.conf
    ##
        :
    #   use the canonical hostname on redirects, etc.
    UseCanonicalName on

        :
    #   add the virtual host in front of the CLF-format
    CustomLog  /path/to/aclearcase/" target="_blank" >ccess_log  "%{VHOST}e %h %l %u %t \"%r\" %>s %b"
        :

    #   enable the rewriting engine in the main server
    RewriteEngine on

    #   define two maps: one for fixing the URL and one which defines
    #   the available virtual hosts with their corresponding
    #   DocumentRoot.
    RewriteMap    lowercase    int:tolower
    RewriteMap    vhost        txt:/path/to/vhost.map

    #   Now do the actual virtual host mapping
    #   via a huge and complicated single rule:
    #
    #   1. make sure we don't map for common locations
    RewriteCond   %{REQUEST_URI}  !^/commonurl1/.*
    RewriteCond   %{REQUEST_URI}  !^/commonurl2/.*
        :
    RewriteCond   %{REQUEST_URI}  !^/commonurlN/.*
    #
    #   2. make sure we have a Host header, because
    #      currently our approach only supports 
    #      virtual hosting through this header
    RewriteCond   %{HTTP_HOST}  !^$
    #
    #   3. lowercase the hostname
    RewriteCond   ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$
    #
    #   4. lookup this hostname in vhost.map and
    #      remember it only when it is a path 
    #      (and not "NONE" from above)
    RewriteCond   ${vhost:%1}  ^(/.*)$
    #
    #   5. finally we can map the URL to its docroot location 
    #      and remember the virtual host for logging puposes
    RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]
        : 
     

    按照上邊做的,好象沒有用,加不加都一樣。
    我用的是apache 1.3.17, 應該包含 rewrite模塊了吧(重新啟動httpd,不報錯誤,說明認識 rewriteengine等指令) 為什么 url rewrite 不起作用?

     kelei 回復于:2003-05-04 23:41:27
    高手快點來啊

    。。。。。。。。

     kelei 回復于:2003-05-05 09:30:08
    鼎鼎頂

     mb 回復于:2003-05-05 13:06:45
    去了httpd.conf下的virtualhost語句
    用miss virtual hosts時,不要再用virtualhost了

     kelei 回復于:2003-05-05 15:59:59
    兩者有沖突,不能混用嗎?

     kelei 回復于:2003-05-05 16:00:19
    [quote:ccde805755="mb"]去了httpd.conf下的virtualhost語句
    用miss virtual hosts時,不要再用virtualhost了[/quote:ccde805755]

    兩者有沖突,不能混用嗎?

     kelei 回復于:2003-05-05 19:17:51
    [quote:4c8e9d710a="mb"]去了httpd.conf下的virtualhost語句
    用miss virtual hosts時,不要再用virtualhost了[/quote:4c8e9d710a]

    我試著去掉 virtualhost, 可以網站都不能訪問了啊,
    應該怎么做???

     kelei 回復于:2003-05-06 22:46:37


     kelei 回復于:2003-05-09 09:30:56
    人氣好差阿,高手們哪里去了?

     HonestQiao 回復于:2003-05-09 09:52:35
    先說說你要達到什么樣的效果

    rewrite可以做得很的事情很多很多的

    如果只是一般的子目錄跳轉

    不必要virtualhost設置的

     kelei 回復于:2003-05-09 18:16:36
    [quote:b89a2d32c4="HonestQiao"]先說說你要達到什么樣的效果

    rewrite可以做得很的事情很多很多的

    如果只是一般的子目錄跳轉

    不必要virtualhost設置的[/quote:b89a2d32c4]

    就像上邊所說的  mass virtualhost
    想用rewrite實現virtualhost, 省的改httpd.conf
    簡化管理

     kelei 回復于:2003-05-12 11:28:16
    Mass Virtual Hosting 


    真的沒有人能幫我嗎?

     macleo 回復于:2003-05-12 12:56:28
    頂了再說!

     mb 回復于:2003-05-12 14:28:25
    選確定你的apache的httpd.conf中是在編譯中加入了rewrite_module支持,要是沒有的話當然是不行了,你的vhost.map文件能被apache組用戶有r權限嗎?

     mb 回復于:2003-05-12 14:29:38
    是的,不能同時用,你用了vhost.map還用virtualhost做什么,有方但的還用哪個老的做什么

     kelei 回復于:2003-05-13 12:30:19
    [quote:af8866a4ef="mb"]選確定你的apache的httpd.conf中是在編譯中加入了rewrite_module支持,要是沒有的話當然是不行了,你的vhost.map文件能被apache組用戶有r權限嗎?[/quote:af8866a4ef]

    我的httpd.conf 加入了rewrite_module支持,而且在.htaccess文件中設置過,也證實了是起作用的

    我的vhost.map文件權限設置 777

    我把 conf 文件中 virtual host 的所有條目都注釋掉了,還是不行

    請問,會有別的可能的原因嗎?

    我的apache 1.3.17

     mb 回復于:2003-05-13 13:38:27
    apache 1.3.17是您編譯時加入了rewrite了,有mod_rewrite.so嗎,默認是沒有的
    vhost中的域名是誰為您解析的,要是能正常指向您服務器的ip的話,哪么您要是能確定rewrite_module以被加載
    在不能訪問時出現了什么提示(apache要是能解析說明您的web頁路徑不對)

     kelei 回復于:2003-05-14 20:31:42
    [quote:06a25c13e4="mb"]apache 1.3.17是您編譯時加入了rewrite了,有mod_rewrite.so嗎,默認是沒有的
    vhost中的域名是誰為您解析的,要是能正常指向您服務器的ip的話,哪么您要是能確定rewrite_module以被加載
    在不能訪問時出現了什么提?.........[/quote:06a25c13e4]
    rewrite.so是靜態模塊,不需要靜態的和apache編譯到一起吧?
    我的系統里有rewirte.so文件
    httpd.conf文件中有 load module 和 addmodule  相關語句, 而且在 htaccess中設置 rewrite 是有效果的,這可以說明 apache沒有問題吧

    domain解吸也是沒有問題的

    Apache的提示就是"找不到網頁 
    您要查看的網頁可能已被刪除、名稱已被更改,或者暫時不可用。 
    "

     mb 回復于:2003-05-15 08:22:47
    The vhost.map file contains something like this:

    www.customer-1.com  /www/customers/1
    www.customer-2.com  /www/customers/2
    # ...
    www.customer-N.com  /www/customers/N



    The http.conf contains this:

    RewriteEngine on

    RewriteMap   lowercase  int:tolower

    # define the map file
    RewriteMap   vhost      txt:/www/conf/vhost.map

    # deal with aliases as above
    RewriteCond  %{REQUEST_URI}               !^/icons/
    RewriteCond  %{REQUEST_URI}               !^/cgi-bin/
    RewriteCond  ${lowercase:%{SERVER_NAME}}  ^(.+)$
    # this does the file-based remap
    RewriteCond  ${vhost:%1}                  ^(/.*)$
    RewriteRule  ^/(.*)$                      %1/docs/$1

    RewriteCond  %{REQUEST_URI}               ^/cgi-bin/
    RewriteCond  ${lowercase:%{SERVER_NAME}}  ^(.+)$
    RewriteCond  ${vhost:%1}                  ^(/.*)$
    RewriteRule  ^/(.*)$                      %1/cgi-bin/$1

    請按以上格式改寫一下

     kelei 回復于:2003-05-15 13:04:10
    按照您給的例子做了,錯誤依舊!

     ykeyhome 回復于:2003-05-27 09:24:20
    up

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>