Вопрос

I'm hosting couple of websites out of my cloud server. And I wanted to use Ghost for the 'blog' subdomain for one of the website.

I've managed to install Ghost and the Development environment works fine in localhost. However, the Production environment which now runs at 2365 port opens perfectly fine at www.blog.foobar.com:2365

I need it to open at just the www.blog.foobar.com

I've tried setting the port to 80 in the config.js and I get the Error: listen EACCES Even the ARR in IIS doesnt work. Tried almost all the steps suggested in the google search results. Reverse proxy just redirects the sub-domain to index.js

  1. Node.js v0.10.21 x64
  2. Ghost 0.3.3
  3. iisnode x64
  4. Windows Server 2012
  5. IIS 8
  6. Firefox

I have the port set to 2365 in config.js as if I set it to 80, it wont start at all. My IIS site binding is at port 80.

Это было полезно?

Решение

Finally figured it out with the help at the ghost forums. Assuming you have iisnode already installed and an A record for your sub-domain at your domain registrar, proceed with:

  1. Change the web.config to as it is at Configuration File
  2. Change the config.js production section as below

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

  3. Leave the bindings as it is in your sub-domain IIS site settings i.e 80

  4. Change the ENV to production in the index.js file instead of development
  5. Enjoy Blogging :)

Другие советы

Here is how I did it on Windows 7.

Part of instructions are here. Others are found here.

Install software

1) Installed node-v0.10.26-x64

2) Installed iisnode-full-iis7-v0.2.2-x64

3) Ran setupsamples.bat inside C:\Program Files\iisnode

Setup Directory

4) Removed everything inside C:\Program Files\iisnode\www

5) Extracted ghost-0.7.1 inside C:\Program Files\iisnode\www

Install Node Modules

6) Ran Node.js command prompt as administrator

7) Typed c:

8) Typed cd C:\Program Files\iisnode\www

9) "npm install --production" | command to install npm

10) Sqlite3 didn't install so had to run "npm install https://github.com/mapbox/node-sqlite3/tarball/master" to install it

Configure

11) Had to install url rewrite

12) Altered C:\Program Files\iisnode\www\config.js under development url: 'http://localhost/blog', port: process.env.PORT

13) still on the node.js command prompt inside C:\Program Files\iisnode\www typed "node.exe index.js" to run it

14) Removed node from iis and added application blog and pointed it to my dir C:\Program Files\iisnode\www

15) Added the web.config inside C:\Program Files\iisnode\www

<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>   
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top