nodejs 开发服务端 部署到 iis 服务器环境 -- iisnode 安装问题解决记录

开发环境

  • nodejs: v10.15.3
  • windows: 10
  • iis: 10

需求:
Nodejs开发了服务端,要部署到IIS

需要在IIS服务器上安装iisnode,结果遇到问题:安装不上


记录一下针对以上问题的调查结果解决方案:

解决过程:

  • 1、 通过 Web Platform Installer 安装 IISNode for IIS,结果失败。

      原因:本机 IIS 10.0,报错:需要 IIS 7.x
      很明显不可能去改用 IIS 7.x

  • 2、 下载 msi 安装包直接安装

      path: Azure/iisnode

  • 3、 安装完成后,查看 Web Platform Installer 里也相应的变为已安装了。

  • 4、 IIS 中新建站点,配置 web.config 并测试你的站点

      结果:访问成功

  参考配置内容贴在下方

  <configuration>
    <system.webServer>
  
      <!-- indicates that the hello.js file is a node.js application 
      to be handled by the iisnode module -->
  
      <handlers>
        <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
      </handlers>
      
      <rewrite>
        <rules>
          <rule name="myapp">
            <match url="/*" />
            <action type="Rewrite" url="server.js" />
          </rule>
        </rules>
      </rewrite>
  
    </system.webServer>
  </configuration>

解决过程中发现网上有人遇到同样问题,但没有找到解决办法,

在某云网站上的提问问题下,为了贴上自己的回答,特意现注册了下。。。

链接在此

posted on 2019-07-31 17:00  CoderMonkey  阅读(1491)  评论(0编辑  收藏  举报

导航