新建两个站点,端口分别使用 80 和 81,在DNS中新建A记录,指向该计算机(10.4.34.41)php
配置过程以下:html
1.在Windows Server 2012 R2上 安装ARR,URL Rewriter组件。web
ARR3.0须要以下组件支持:Web Farm Framework 2.2(该组件又须要Web Platform Installer 3.0 和 WebDeploy 2.0组件的支持)正则表达式
URL Rewriter2.0(For IIS7.0,支持Win 2012 R2)直接安装便可。app
下载地址:http://www.iis.net/downloads/microsoft/application-request-routingpost
http://www.iis.net/downloads/microsoft/web-farm-frameworkurl
配置完成后以下图:.net
在外部访问 la80.ddv.com 和la81.ddv.com能够访问成功。代理
经过配置web.config文件,也能够实现 URL重写,以下:orm
<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