Errors with local install for Windows Server 2016

Hello all. I think Ghost looks excellent and I’m trying to perform a local install to play around with the facilities. I’d like to list the steps I took to install the system, with a view to identifying where I went wrong.

Aim: Install Ghost to port 2368 and locally test installation

System Configuration

  • Windows Server 2016
  • IIS 10
  • 16GB RAM

Ghost Prerequisites

  1. NPM
  2. NodeJS
  3. SQLite
  4. IISNode
  5. Ghost

Prerequisites Install

  1. Download and install Node.JS using defaults

  2. Confirm installation of Node.JS and npm
    node -v
    npm -v

  3. Update npm
    npm install npm@latest -g

  4. Download and install URL Rewrite

  5. Download and install IISNode

  6. Create Ghost directory
    mkdir "C:\inetpub\wwwroot\blog"

  7. Set iisnode permissions
    icacls "C:\Program Files\nodejs\node.exe" /grant IIS_IUSRS:(OI)(CI)F
    icacls "C:\inetpub\wwwroot\blog" /grant IIS_IUSRS:(OI)(CI)F

  8. Run setup samples
    "C:\Program Files\iisnode\setupsamples.bat"

Ghost Install

  1. Install Ghost CLI
    cd "C:\inetpub\wwwroot\blog"
    npm install -g ghost-cli@latest

  2. Set environment values
    set NODE_ENV=production
    set GHOST_DIR="C:\inetpub\wwwroot\blog"

  3. Install Ghost
    ghost install --db sqlite3 --no-prompt --no-stack --no-setup --dir "%GHOST_DIR%"
    cd "%GHOST_DIR%"
    ghost config --ip 127.0.0.1 --port 2368 --no-prompt --db sqlite3 --url http://localhost:2368

  4. Create Ghost database
    ghost setup migrate

Ghost Configure

  1. Open config.production.json : notepad config.production.json
    { "url": "http://localhost:2368", "server": { "port": 2368, "host": "127.0.0.1" }, }

  2. Create an index.js file in C:\inetpub\wwwroot\blog : notepad index.js
    process.env.server__port = process.env.PORT; require('./current/index.js')

  3. Create web.config : notepad web.config
    <configuration> <system.webServer> <modules> <remove name="WebDAVModule" /> </modules> <handlers> <clear /> <remove name="WebDAV" /> <add name="iisnode" path="index.js" verb="*" type="" modules="iisnode" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" /> </handlers> <iisnode node_env="production" enableXFF="true" nodeProcessCountPerApplication="1" /> <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> <httpErrors existingResponse="PassThrough" /> </system.webServer> </configuration>

  4. Tests
    Test: localhost/node/
    Result: “hosting node.js applications in IIS since 2011”
    Test: node.exe index.js
    Result:
    [2018-10-23 18:13:35] WARN Theme’s file locales/en.json not found.
    [2018-10-23 18:13:38] ERROR

NAME: InternalServerError
MESSAGE: (Code: EACCES)

level:normal

“There was an error starting your server.”
“Please use the error code above to search for a solution.”
ERROR DETAILS:
empty

InternalServerError: (Code: EACCES)
at new GhostError (C:\inetpub\wwwroot\blog\versions\2.3.0\core\server\lib\common\errors.js:10:26)
at Server. (C:\inetpub\wwwroot\blog\versions\2.3.0\core\server\ghost-server.js:85:30)
at emitOne (events.js:116:13)
at Server.emit (events.js:211:7)
at emitErrorNT (net.js:1380:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)

Test: localhost:2368/
Result: This page can’t be displayed
Test: localhost:2368/ghost
Result: This page can’t be displayed
Test: localhost/blog/
Result: 503 Site is starting up, please wait a moment then retry.
Test: localhost/blog/
Result: 404 Page not found

Issue: It doesn’t matter what I do, I can’t get the server to render the Ghost welcome page. Where did I go wrong? What did I miss?

I’m no windows expert, but the EACCES error you’re receiving usually means that it wasn’t possible to bind to port 2368.

Not sure if you realise you copied the command to get the node & npm version instead of including the version.

You can also try ghost doctor to see if there is any useful debug output. ghost install local will also set you up in development mode, which uses a local process manager and sqlite3 by default. Should reduce the number of commands you need to try to get somewhere - there’s no real need for all the web server tech if you’re just running locally.

I’ll research the port binding issue.

I did have more details but because I’m a new user I was limited in what I could paste:
node v8.12.0
npm 6.4.1

Using ghost doctor doesn’t return anything of use:

Process manager ‘systemd’ will not run on this system, defaulting to ‘local’
√ Checking system Node.js version
√ Checking current folder permissions
System checks failed with message: ‘Operating system is not Linux’
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes
i Checking operating system compatibility [skipped]
√ Validating config
× Checking folder permissions
× Checking file permissions
√ Checking memory availability
One or more errors occurred.

  1. Checking folder permissions

Message: Command failed: C:\Windows\system32\cmd.exe /q /s /c “find ./ -type d ! -perm 775 ! -perm 755”
FIND: Parameter format not correct

Exit code: 2

  1. Checking file permissions

Message: Command failed: C:\Windows\system32\cmd.exe /q /s /c “find ./ -type f ! -path “./versions/*” ! -perm 664 ! -perm 644”
File not found - ./
File not found - -TYPE
File not found - F
File not found - !
File not found - -PATH
File not found - !
File not found - -PERM
File not found - 664
File not found - !
File not found - -PERM
File not found - 644

Exit code: 1

Debug Information:
OS: Microsoft Windows, v10.0.14393
Node Version: v8.12.0
Ghost-CLI Version: 1.9.6
Environment: production
Command: ‘ghost doctor’

Additional log info available in: C:\Users[username].ghost\logs\ghost-cli-debug-2018-10-23T19_52_26_251Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://docs.ghost.org/docs/troubleshooting#section-cli-errors for troubleshooting.

I’d like to continue analysing this, so off to do binding research.

Progress!

Test: node current\index.js
Result: Success!

[2018-10-23 20:21:01] WARN Theme’s file locales/en.json not found.
[2018-10-23 20:21:03] INFO Ghost is running in development…
[2018-10-23 20:21:03] INFO Listening on: 127.0.0.1:2368
[2018-10-23 20:21:03] INFO Url configured as: http://localhost:2368/
[2018-10-23 20:21:03] INFO Ctrl+C to shut down
[2018-10-23 20:21:03] INFO Ghost boot 9.906s

I can view the sites on localhost:2368/ and localhost:2368/ghost - this is positive! Two outstanding things:

  1. Ghost appears to be running in development mode despite adjusting config.production.json
  2. I need to fix the .\blog\index.js to forward to .\blog\current\index.js

Further research!

Still no luck with the research. Anyone else configured ghost for Windows Server?

I know its a pain :nauseated_face: but by advice :bulb: would be for you to install:

or some othert form of soft virtualization because the install procedure of ghost -for me- tend to be rather error prune + time consuming :mantelpiece_clock: (large number of dependencies with large number of small files) which are also not the dream of NTFS :slight_smile:

Docker isn’t working out for me on Windows. I can’t switch between Windows and Linux mode on the command line.

It was just an idea :(. I use it in local development with WSL (Debian)

It’s a good idea - it’s just that I wanted a command line only installation, and the version of Docker I used -
EE - doesn’t support switching container modes. Or at least the extensive searching I’ve done didn’t lead to anything useful there.

I switched back to running locally - rather in Production mode - and I’ve still got issues. I can view the main site, but I cannot seem to get to the administration page.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.