【问题标题】:Running Ghost on Windows Server 2012 in port 80在 Windows Server 2012 的 80 端口上运行 Ghost
【发布时间】:2013-10-24 15:09:32
【问题描述】:

我正在使用我的云服务器托管几个网站。我想将 Ghost 用于其中一个网站的“博客”子域。

我已经成功安装了 Ghost,并且开发环境在 localhost 中运行良好。但是,现在在 2365 端口上运行的生产环境在 www.blog.foobar.com:2365 上可以正常打开

我只需要在 www.blog.foobar.com 上打开它

我尝试在 config.js 中将端口设置为 80,但出现错误:listen EACCES 即使 IIS 中的 ARR 也不起作用。尝试了谷歌搜索结果中建议的几乎所有步骤。反向代理只是将子域重定向到 index.js

  1. Node.js v0.10.21 x64
  2. 幽灵 0.3.3
  3. iisnode x64
  4. Windows 服务器 2012
  5. IIS 8
  6. 火狐

我在 config.js 中将端口设置为 2365,就像我将其设置为 80 一样,它根本不会启动。我的 IIS 站点绑定在端口 80。

【问题讨论】:

    标签: iis ghost-blog


    【解决方案1】:

    终于在幽灵论坛的帮助下弄明白了。假设您已经安装了 iisnode 并且在您的域注册商处为您的子域提供了 A 记录,请继续:

    1. web.config 更改为Configuration File
    2. 如下更改 config.js 生产部分

      host: '127.0.0.1', port: process.env.PORT

    3. bindings 保留在您的子域 IIS 站点设置中,即 80

    4. index.js 文件中将ENV 更改为production,而不是development
    5. 享受写博客的乐趣:)

    【讨论】:

    • 额外空间是罪魁祸首
    • 我们必须如何在 index.js 文件中将 ENV 更改为生产环境?
    【解决方案2】:

    这是我在 Windows 7 上的操作方式。

    instructions are here 的一部分。 其他人是found here

    安装软件

    1) 已安装node-v0.10.26-x64

    2) 已安装iisnode-full-iis7-v0.2.2-x64

    3) 在 C:\Program Files\iisnode 中运行 setupsamples.bat

    设置目录

    4) 删除 C:\Program Files\iisnode\www 中的所有内容

    5) 在 C:\Program Files\iisnode\www 中提取 ghost-0.7.1

    安装节点模块

    6) 以管理员身份运行 Node.js 命令提示符

    7) 键入 c:

    8) 键入 cd C:\Program Files\iisnode\www

    9) "npm install --production" |安装 npm 的命令

    10) Sqlite3 没有安装,所以必须运行“npm install https://github.com/mapbox/node-sqlite3/tarball/master”来安装它

    配置

    11) 必须安装url rewrite

    12) 更改 C:\Program Files\iisnode\www\config.js 正在开发中 网址:'http://localhost/blog', 端口:process.env.PORT

    13) 仍在 C:\Program Files\iisnode\www 内的 node.js 命令提示符上键入“node.exe index.js”来运行它

    14) 从 iis 中删除节点并添加应用程序博客并将其指向我的目录 C:\Program Files\iisnode\www

    15) 在 C:\Program Files\iisnode\www 中添加了 web.config

    <configuration>  
    <system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    <handlers>
            <remove name="WebDAV" />
      <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
      <add name="WebDAV" path="*" verb="" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />
    </handlers>
    <defaultDocument enabled="true">
      <files>
        <add value="index.js" />
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
        <rule name="Ghost">
          <match url="/*" />
          <conditions>
            <add input="{PATH_INFO}" pattern=".+\.js\/debug\/?" negate="true" />
          </conditions>          
          <action type="Rewrite" url="index.js" />
        </rule>
      </rules>
    </rewrite>
    <!--
      See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for information regarding iisnode specific configuration options.
    -->
    <iisnode node_env="%node_env%" loggingEnabled="false" debuggingEnabled="false" devErrorsEnabled="false" />
    </system.webServer>
    </configuration>   
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-25
      • 1970-01-01
      • 2011-11-13
      • 2013-10-02
      • 2015-02-24
      • 2019-03-01
      • 2012-07-01
      相关资源
      最近更新 更多