新建兩個站點,端口分別使用 80 和 81,在DNS中新建A記錄,指向該計算機(10.4.34.41)
配置過程如下:
1.在Windows Server 2012 R2上 安裝ARR,URL Rewriter組件。
ARR3.0需要如下組件支持:Web Farm Framework 2.2(該組件又需要Web Platform Installer 3.0 和 WebDeploy 2.0組件的支持)
URL Rewriter2.0(For IIS7.0,支持Win 2012 R2)直接安裝即可。
下載地址:http://www.iis.net/downloads/microsoft/application-request-routing
http://www.iis.net/downloads/microsoft/web-farm-framework




配置完成后如下圖:
在外部訪問 la80.ddv.com 和la81.ddv.com可以訪問成功。
通過配置web.config文件,也可以實現 URL重寫,如下:
<rewrite>
<rules>
<rule name="phpweb">
<match url="^(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^phpweb.leven.com.cn$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/{R:1}" />
</rule>
</rules>
</rewrite>
參考來源:http://blog.sina.com.cn/s/blog_532f78a40100rlpn.html
ARR安裝完成后,如果在IIS里面看不到ARR圖標,解決方法如下:
1.分別通過如下命令打開 IIS管理器,查看有無ARR圖標:
%windir%\System32\inetsrv\iis.msc
%windir%\system32\inetsrv\InetMgr.exe
2.通過PS腳本檢查ARR是否安裝成功:
$dll=[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
#Get the manager and config object
$mgr = new-object Microsoft.Web.Administration.ServerManager
$conf = $mgr.GetApplicationHostConfiguration()
#Get the webFarms section
$section = $conf.GetSection("webFarms")
$section