- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
IIS什么的就不多说了,直接说主要用的东西,iisnode。下载地址。
另外还需要安装URL Rewrite。
安装iisnode之后,可以用%programfiles%\iisnode\setupsamples.bat
来安装一个例子,然后访问http://www.landui.com/node
。
安装完之后,新建一个站点,监听80端口,配置好自己的域名。
web.config配置可以参考github中samples中的configuration.
<configuration> <system.webServer> <handlers> <add name="iisnode" path="launch.js" verb="*" modules="iisnode" resourceType="Unspecified" requireAccess="Script" /> </handlers> <rewrite> <rules> <rule name="all"> <match url="/*" /> <action type="Rewrite" url="launch.js" /> </rule> </rules> </rewrite> <iisnode nodeProcessCommandLine=""C:\Program Files\nodejs\node.exe"" interceptor=""C:\Program Files\iisnode\interceptor.js"" promoteServerVars="REMOTE_ADDR"/> </system.webServer></configuration>
因为bin
会在url重写时被IIS屏蔽,因此不能直接把url重写到bin/www
上,因此需要增加一个中间文件,或者修改bin
目录的名字(当然是不推荐的)。
launch.js很简单,只需要require一下bin/www
.
require('./bin/www');
接下来重启站点就可以了。
如果运行的时候出现如下错误:
500.19
配置错误 不能在此路径中使用此配置节。如果在父级别上锁定了该节,便会出现这种情况。锁定是默认设置的(overrideModeDefault="Deny"),或者是通过包含 overrideMode="Deny" 或旧有的 allowOverride="false" 的位置标记明确设置的。
这时候只要运行%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/handlers
其中的handlers是报错的节点名字。
转载地址:https://www.landui.com/FJH1994/p/6292286.html
售前咨询
售后咨询
备案咨询
二维码
TOP