IIS(windows server 2008)设置虚拟目录

来源:互联网 发布:百度的人工智能怎么样 编辑:程序博客网 时间:2024/06/05 18:43

1、右键网站添加虚拟目录:


2、编辑虚拟目录:



上图编辑虚拟目录对话框中的“物理路径(P)”中可以填写远程主机,比如: \\192.168.45.200\share,然后点击“链接为“按钮

      如果点击确定出现 ”指定密码无效,请键入新密码“ 的提示框,说明密码有误,可添加域名尝试,如:domain\zhangsan。

      保证真实目录对输入的用户有权限操作。

      然后一路点击确定,回到”编辑虚拟目录“界面。

3、测试连接

     点击”测试设置“按钮,出现如下界面,结果均为绿色,目录设置成功。


4、修改配置文件

在<system.web>节点中添加你刚刚输入的用户信息<identity impersonate="true" userName="tech" password="password" />,配置完成的XML如下:

<?xml version="1.0" encoding="UTF-8"?><!--  有关如何配置 ASP.NET 应用程序的详细信息,请访问  http://go.microsoft.com/fwlink/?LinkId=169433  --><configuration><connectionStrings><add name="ApplicationServices" connectionString="server=192.168.123.123;database=database;uid=uid;pwd=password" providerName="System.Data.SqlClient" /></connectionStrings><system.web><identity impersonate="true" userName="tech" password="password" /><!--错误页--><customErrors  mode="On" defaultRedirect="error.htm"/><sessionState mode="InProc" timeout="120"/><compilation debug="true" targetFramework="4.0" /><authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880" /></authentication><membership><providers><clear /><add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /></providers></membership><profile><providers><clear /><add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /></providers></profile><roleManager enabled="false"><providers><clear /><add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /><add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /></providers></roleManager><pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" /><httpRuntime maxRequestLength="300000000" executionTimeout="120" /></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true" /><security><requestFiltering><requestLimits maxAllowedContentLength="1000000000" /></requestFiltering></security><staticContent><remove fileExtension=".flv" /><mimeMap fileExtension=".mp4" mimeType="mp4-application/octet-stream" /><mimeMap fileExtension=".flv" mimeType="video/x-flv" /><mimeMap fileExtension=".vob" mimeType="video/quicktime" /></staticContent></system.webServer><appSettings><add key="ffmpeg" value="F:\web site\videoTool\ffmpeg\bin\ffmpeg.exe"/><add key="picSnapSize" value="100*100"/><add key="exceptDeparts" value="中心/技术部" /></appSettings></configuration>



至此,配置结束。欢迎批评指正。


0 0