ruethewhirl551
ruethewhirl551

Reputation: 63

Running Ghost in IIS with Iisnode

I have a problem getting iisnode and ghost to play together.

I can run the samples supplied with iisnode fine and I can get ghost up and running fine through the node command line. I have followed every blog post written online I can find to get them set up together. The frustrating thing is the blogs make this process look extremely straightforward.

From looking at "ETW" logs it looks like iisnode cannot communicate with the node process using named pipes ("iisnode scheduled a retry of a named pipe connection to the node.exe process" x20+), and then the node process terminates.

The problem may not lie with ghost, tbh I cannot work out what to do or which part to tweak next. My best guess at this point is some sort of permissions issue, but I've spent hours setting permissions all over my development machine to no avail.

If it helps, the error message I get back in the browser is: ERROR: (Code: EACCES) There was an error starting your server.

Upvotes: 2

Views: 464

Answers (2)

Uwe Keim
Uwe Keim

Reputation: 40746

Just to clarify what ruethewhirl551 said, here is an excerpt from my working "config.js":

config = {
    production: {
        url: 'http://my-blog.com',
        mail: {
            transport: 'SMTP',
            options: {
                service: 'Mailgun',
                auth: {
                    user: '[email protected]',
                    pass: '9ed512da012cd454376947365xd71793'
                }
            }
        },
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: process.env.PORT // <-- HERE
        }
    },

    // ...

Please notice the line port: process.env.PORT at the bottom.

You can also search for "iisnode" through the "config.example.js" file for more information.

Upvotes: 1

ruethewhirl551
ruethewhirl551

Reputation: 63

To answer my own question, I examined the Process Monitor output for node.exe, line by line to see if I could see anything strange. I'm no expert at analysing the output from Process Monitor and there are a tonne of "Buffer Overflow" messages and other things that could be errors, but then I happened to stumble upon the following line:

Node.exe CreatePipe \MyProjects\WebsiteName\process.env.port\ INVALIDDEVICEREQUEST

Invalid device?

Then the penny finally dropped. In config.js you do not want to set your port to 'process.env.port' (as is suggested in the config.js file itself as a comment) you want to set the port to process.env.port.

No quotes.

Upvotes: 3

Related Questions