iisNode默认安装失败在Windows 11,500.19内部服务器错误

gkl3eglg  于 2023-08-04  发布在  Node.js
关注(0)|答案(1)|浏览(107)

在我的新Windows 11计算机上安装了Node v18.17.0,该计算机运行IIS v10.0.22621.1,我继续下载iisNode(v0.2.26,日期为2017年2月21日)和MS urlRewrite。我一直在遵循哈维·威廉姆斯的指示(https://www.youtube.com/watch?v=JUYCDnqR8p0,也读了他的博客文章(虽然有点过时,2016)。指令的最后一步指示我将目录更改为“C:\Program Files\iisNode”并运行setupSamples.bat(没有错误),当完成时,我打开浏览器到http://localhost/node。这将显示预期的页面,其中包含几个示例链接。

问题所有示例链接都不工作!它们都返回相同的IIS 500.19错误页。

具体错误码为:0x80070021。

配置错误显示:此配置节不能在此路径上使用。在父级锁定节时会发生这种情况。锁定是默认的(overrideModeDefault=“Deny”),或者通过位置标记用overrideMode=“Deny”或传统allowOverride=“false”显式设置。

请求的URL:http://localhost:80/node/helloworld/readme.htm

物理路径:c:\Program Files\iisnode\www\helloworld\readme.htm

在IIS错误页面的【配置源】部分,显示:

35: to be handled by the iisnode module -->
36: <handlers>
37: <add name="iisnode" path="hello.js" verb="*" modules="iisnode" />

字符串
虽然我不是windows操作系统Maven,但iisNode安装程序在Program Files下创建了一个Web服务器文件夹,这对我来说似乎很奇怪。正如上面的配置错误消息所示,可能在父文件夹中有权限设置。Program Files\iisNode没有任何IIS_IUSER帐户,但尝试访问的子文件夹\www具有完全控制权。
也不清楚,如果默认的网站应用程序池可能会导致问题,但他是如何“节点”网站被添加到IIS的安装程序。
作为参考,web.config文件包含以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<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="hello.js" verb="*" modules="iisnode" />
        </handlers>
        <!-- use URL rewriting to redirect the entire branch of the URL namespace
        to hello.js node.js application; for example, the following URLs will 
        all be handled by hello.js:
        
            http://localhost/node/urlrewrite/hello
            http://localhost/node/urlrewrite/hello/foo
            http://localhost/node/urlrewrite/hello/foo/bar/baz?param=bat
            
        -->    
        <rewrite>
        <rules>
            <rule name="hello">
            <match url="hello/*" />
            <action type="Rewrite" url="hello.js" />
            </rule>
        </rules>
        </rewrite>
    </system.webServer>
</configuration>


在我在这台新机器上回退到Windows 10并重试之前,我希望有人能确认stackOverflow Post中提到的iisNode和引用此Microsoft github fork实际上将在Windows 11(IIS v10)中运行,并可能建议哪些权限或其他可能的配置设置可能不正确。

x0fgdtte

x0fgdtte1#

哇,我又找了几个小时才找到答案。各种下载版本和配置设置几乎完全正确。问题又回到了在计算机上安装IIS的问题。我只是猜测,但在以前的Windows版本上,IIS必须安装有更多的功能打开,因为所需的功能没有在我读过的任何帮助文档中描述。我发现并阅读了IIS配置错误,其中描述了在“应用程序开发功能”下启用除CGI之外的所有功能。完成此操作并重新启动IIS后,setupSample页面全部正常工作。
希望这能保存我花在解决这个问题上的其他人,现在回到编码!

相关问题