【问题标题】:Changing Web.Config for SSL Website更改 SSL 网站的 Web.Config
【发布时间】:2011-05-06 00:00:47
【问题描述】:

你好:

我有一个端口号为 99 的 SSL 网站。在我的 web.config 中,为了通过这个 SSL 端口,我必须进行哪些更改以及在哪里进行更改?

这是我的 Web.Config 文件:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="Test.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
  </connectionStrings>
  <system.web>
    <compilation debug="false" targetFramework="4.0" />
    <authentication mode="Forms">
      <forms loginUrl="Default.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>
  </system.web>
  <system.webServer>
    <security>
      <access sslFlags="Ssl"/>
       </security>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

网站向我显示了这个错误:

页面无法显示 您尝试执行 CGI, ISAPI 或其他可执行程序 来自不允许的目录

要执行的程序。

请尝试以下方法: •联系 网站管理员,如果您 相信这个目录应该允许 执行访问。 HTTP 错误 403.1 - 禁止:执行访问被拒绝。

互联网信息服务 (IIS)

这是我的 IIS 6.0 设置的样子:

不知道这里应该做什么?有人对此有任何想法吗?谢谢!

【问题讨论】:

  • 这看起来像是 IIS 配置问题。您能否找到有关您托管网站的基础架构的更多信息(IIS6 与 IIS7/7.5 等)。 http/https 端口也是在 IIS 中配置的,这就是为什么在 Web.Config 中找不到配置项
  • 这是一个 IIS 配置错误。您需要授予 Web 应用程序的执行权限。正如@Tr1stan 所说,您如何做到这一点取决于您运行的 IIS 版本。

标签: c# asp.net web-config web-deployment


【解决方案1】:

Here is an image 显示您在 IIS 管理器中授予 IIS6 中执行权限的位置

【讨论】:

  • 我这样做了,但仍然犯同样的错误。我用图片编辑了我的问题,你能看一下吗?
  • @klm9971:您肯定配置了正确的 IIS 部分,您没有将这个特定站点托管在一个虚拟目录中,该虚拟目录是您现在向我们展示的根配置的子项?
  • @T:是的!该网站托管在具有根目录的外部服务器中,并且在该根目录中有一个文件夹....我该怎么办?
  • @klm9971:尝试设置与您为 root 设置相同的配置(仅脚本...或脚本和可执行文件),但在托管 Web 应用程序的虚拟目录上。跨度>
  • @T: 在主目录下执行权限为:NONE
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-04
  • 1970-01-01
相关资源
最近更新 更多