如何使用iisnode在IIS上运行Etherpad Lite?
(经过进一步调查后更新了2013-04-23 )
My steps (第一次尝试)
c:\eplite,并确保它在与start.bat一起运行时工作。c:\eplite的完全控制(过高,但确保没有访问问题)。c:\eplite的IIS站点。c:\eplite\node_modules\ep_etherpad-lite\Web.config移动到c:\eplite。打开IE,我可以看到“类似”的以太垫,但它不工作。在主页上没有文本(只有字段和按钮),试图打开pad会导致与文本不工作的pad接口:
An error occured while loading the pad
Invalid argument. in http://localhost/static/js/l10n.js (line 1)我的步骤(第二次尝试,在阅读了讨论之后,这里)
7.编辑settings.json:删除port。
8.创建c:\eplite\start_iisnode.bat:
cd c:\eplite
node "c:\Program Files\iisnode\interceptor.js" "c:\eplite\node_modules\ep_etherpad-lite\node\server.js"9.向Web.Config添加了以下行:
打开IE,这一次我可以看到正确的起始页面。打开衬垫会导致使用文本的pad界面不工作:
An error occured while loading the pad
The module at "ep_etherpad-lite/static/js/rjquery" does not exist. in http://localhost/static/js/require-kernel.js (line 1)根据进程监视器,它试图在以下路径中找到该模块:
C:\eplite\node_modules\ep_etherpad-lite\static\pipe\fb92fd16-78e4-4f00-bac4-6a4935ebd0d4\static\plugins\ep_etherpad-lite\static\js\rjquery.js,我还试过什么?
node_modules\ep_etherpad-lite路径。结果与最初的步骤1-6相同。node_modules\ep_etherpad-lite路径。结果与最初的步骤1-9相同。版本信息
来自“主”代码分支的Etherpad Lite (最新版本为1.2.10),是用installOnWindows.bat构建的。
节点版本0.8.4 x64,iisnode版本0.2.4 x64。
运行在Windows 8上。
发布于 2014-10-15 21:57:16
在阅读了您和其他人在您提到的讨论中的回复后,我让它工作起来,尽管它不是一个完美的解决方案,还有一些硬编码的选项。
前六步和你的相同。
对于步骤7,不要删除settings.json中的端口,因为这将在接下来的步骤中使用。
步骤8和步骤9不是必需的,但您可以将web.config的内容更改为此,如@鬼的 post中所示:
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
<match url="iisnode" />
<action type="Rewrite" url="node_modules/ep_etherpad-lite/node/iisnode" />
</rule>
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?" />
</rule>
<rule name="StaticContent">
<action type="Rewrite" url="public{{REQUEST_URI}}" />
</rule>
<rule name="DynamicContent">
<conditions>
<add input="{{REQUEST_FILENAME}}" matchType="IsFile" negate="True" />
</conditions>
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>然后,创建一个符号链接,从etherpad的根路径(例如c:\eplite)到实际的server.js server.js这可以通过使用MKLINK来完成。在本例中,您可以在cmd中键入以下内容:
mklink c:\eplite\server.js C:\eplite\node_modules\ep_etherpad-lite\node\server.js“这解决了Node遇到的一些奇怪的操作/模块未找到的问题。”然后,我们需要添加http-代理模块到etherpad-lite。将cmd中的当前文档设置为C:\eplite\node_ codes \ep_etherpad-lite并运行npm更新& npm,安装http-代理,最后将这些代码放在server.js的开头:
var http = require('http'),
httpProxy = require('http-proxy');
httpProxy.createProxyServer({target:'http://localhost:9001'}).listen(process.env.PORT); 注意,目标路径中的端口应该与setting.json中的端口相同,否则您无法从IIS中绑定的路径到达etherpad站点。
我试图用settings.port替换硬代码或目标路径,但这没有起作用,而且会出现一个错误:如果我将npm.load()放在asyns.waterfall部件之前,就需要。如果我将创建代码的代理放在asyns.waterfall内部的任何回调函数中,就会出现一个错误:连接EADDRNOTAVAIL。我想知道是否还有其他更好的解决方案来集成IIS和以太垫。谢谢!
我的环境是开发分支的Win7 + Node.Js 0.10 + IIS7 +iisnodev0.2.16+ etherpad Lite (最新版本为1.4.10)。
https://stackoverflow.com/questions/16104112
复制相似问题