【问题标题】:How to run Etherpad Lite on iisnode如何在 iisnode 上运行 Etherpad Lite
【发布时间】:2013-04-19 11:58:22
【问题描述】:

如何使用 iisnode 在 IIS 上运行 Etherpad Lite?

(经过更多调查后于 2013 年 4 月 23 日更新)

我的步骤(第一次尝试)

  1. 将 Etherpad Lite 安装到 c:\eplite 并确保它在使用 start.bat 运行时可以正常工作。
  2. 为 IIS 安装 URL 重写模块(iisnode 需要)。
  3. 安装 iisnode。
  4. 授予 IIS_IUSRS 对整个 c:\eplite 的完全控制权(有点矫枉过正,但要确保没有访问问题)。
  5. 配置指向c:\eplite的IIS网站。
  6. c:\eplite\node_modules\ep_etherpad-lite\Web.config 移动到c:\eplite

打开 IE,我可以看到“类似”etherpad 的东西,但它不起作用。在主页上没有文本(只有字段和按钮),尝试打开 pad 会导致 pad 界面无法正常工作:

An error occured while loading the pad
Invalid argument. in http://localhost/static/js/l10n.js (line 1)

我的步骤(第二次尝试,阅读讨论后here

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 会导致 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

我还尝试了什么

  1. 步骤 1-4 + 配置指向 c:\eplite\node_modules\ep_etherpad-lite(Web.config 位置)的 IIS 网站 + 从 Web.Config 中的任何位置删除 node_modules\ep_etherpad-lite 路径。结果与原始步骤 1-6 相同。

  2. 步骤 1-4,7-9 + 配置指向 c:\eplite\node_modules\ep_etherpad-lite(Web.config 位置)的 IIS 网站 + 从 Web.Config 中的任何位置删除 node_modules\ep_etherpad-lite 路径。结果与原始步骤 1-9 相同。

版本信息

来自“master”代码分支的 Etherpad Lite(最新版本是 1.2.10),使用 installOnWindows.bat 构建。

节点版本 0.8.4 x64,iisnode 版本 0.2.4 x64。

在 Windows 8 上运行。

【问题讨论】:

  • 你有没有让这个工作——我现在正在尝试同样的事情?
  • 没有。我正在尝试的项目现在已经关闭,所以我放弃了。
  • 对于寻找答案的人,我已经记录了我最近在 Windows 上运行 Etherpad 的经验。 here on my blog
  • @kmonsoor 如我所见,您只是使用 start.bat 运行它,而不是 IIS。

标签: iisnode etherpad


【解决方案1】:

在阅读了您提到的discussion 中您和其他人的回复后,我让它工作了,虽然它不是一个完美的解决方案,并且有一些硬编码选项。

前六个步骤与您的相同。

对于第 7 步,请勿删除 settings.json 中的端口,因为这将在接下来的步骤中使用。

第 8 步和第 9 步不是必需的,但您可以将 web.config 的内容更改为 @ghost's 帖子中所示的内容:

<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 文件(C:\eplite\node_modules\ep_etherpad-lite\node\server.js)建立一个符号链接。这可以通过使用 MKLINK 来完成。在本例中,您可以在 cmd 中键入:

mklink c:\eplite\server.js C:\eplite\node_modules\ep_etherpad-lite\node\server.js

“这解决了 Node 遇到的一些奇怪的路径/模块未找到问题。”然后我们需要将 http-proxy 模块添加到 etherpad-lite。将cmd中的当前文档设置为C:\eplite\node_modules\ep_etherpad-lite 并运行npm update & npm install http-proxy,最后将这些代码放在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 来删除硬代码或目标路径,但这不起作用,如果出现 error: npm.load() required我把它放在 asyncs.waterfall 部分之前。如果我将代理创建代码放在 asyncs.waterfall 内的任何回调函数中,将会出现 Error: connect EADDRNOTAVAIL。我想知道是否还有其他更好的集成 IIS 和 etherpad 的解决方案。谢谢!。

我的环境是 Win7 + Node.Js 0.10 + IIS7 + iisnode v0.2.16 + 来自开发分支的 etherpad Lite(最新版本是 1.4.10)

【讨论】:

  • 我尝试运行 etherpad 的项目很久以前就关闭了,所以我无法尝试您的解决方案。也许,它会帮助别人。
猜你喜欢
  • 2016-06-20
  • 2017-04-26
  • 1970-01-01
  • 2021-06-18
  • 2021-01-14
  • 2012-08-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多