Windows Server 2008安装IIS 7与配置

1、安装IIS 7

     一、鼠标右键【个人电脑(Computer)】→【管理(Manager)】web

        1

     二、选择【角色(Roles)】,右键【添加角色(Add Roles)】,弹出【添加角色向导(Add Roles Wizard)】选择【下一步(Next)】服务器

         image

         image

    三、勾选【Web服务器IIS(Web Server IIS)】mvc

         image

         image

    四、勾选须要安装的角色服务(Server Roles)app

         image

         image

         image

    五、选择完角色服务后,点击【安装(Install)】等待安装完成less

         image

         image

         image

2、IIS配置相关

 

    一、IIS应用池添加.NET Framework 4.0:svg

         解决如下问题:字体

         HTTP Error 500.21 - Internal Server Error

          Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

1)【开始】菜单→【运行】→C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i  (或 %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i)网站

2) 打开【Internet Information Services (IIS) Manager】,选择【Application Pools】→【Classic .NET AppPool】和【DefaultAppPool】,修改.NET Framework的版本this

image

     二、让Windows 64位的操做系统,兼容32位应用程序:应用程序池【DefaultAppPool】→选择【高级设置】→【启用32位应用程序】设置为 True便可。spa

         2

         image

    三、让IIS支持svg/woff/woff2字体

1)打开【Internet Information Services (IIS) Manager】,选择某个网站→【MIME类型(MIME Types)】

2)添加MIME类型

  文件扩展名   MIME类型

  .svg       image/svg+xml

  .woff      application/x-font-woff

  .woff2      application/x-font-woff

    四、解决iis 7上发布mvc报错:403.14-Forbidden Web 服务器被配置为不列出此目录的内容

         HTTP Error 403.14 - Forbidden

         The Web server is configured to not list the contents of this directory.

1)解决方法一:

  • 若是不但愿启用目录浏览,请确保配置了默认文档而且该文件存在。
  • 使用 IIS 管理器启用目录浏览。
    •  打开 IIS 管理器。
    •  在“功能”视图中,双击“目录浏览”。
    •  在“目录浏览”页上,在“操做”窗格中单击“启用”。
  • 确认站点或应用程序配置文件中的 configuration/system.webServer/directoryBrowse@enabled 特性被设置为 True。

2)解决方法二:修改配置文件web.config

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>

      设置<modules>节的值为true就能够了, 而目录浏览启用或禁用都不受影响。

相关文章
相关标签/搜索