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

问题描述 投票:0回答:1

在运行 IIS v10.0.22621.1 的新 Windows 11 计算机上安装 Node v18.17.0 后,我继续下载 iisNode(v0.2.26,日期为 2/21/2017)和 MS urlRewrite。我一直遵循 Harvey Williams 的指示(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 eadme.htm 在 IIS 错误页面的

Config Source

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

尽管我不是 Windows 操作系统专家,但 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 的 iisNode 实际上会在 Windows 11 中运行(IIS v10 )并可能建议哪些权限或其他可能的配置设置可能不正确。

node.js iis windows-11 iisnode
1个回答
0
投票
IIS配置错误

,其中描述了在“应用程序开发功能”下启用除CGI之外的所有功能。执行此操作并重新启动 IIS 后,setupSample 页面全部正常工作。 希望这可以帮助其他人节省我花在解决这个问题上的时间,现在回到编码!

© www.soinside.com 2019 - 2024. All rights reserved.