Skip to content

Deploying Ogre on Windows Server

Ben Fousek edited this page Nov 6, 2015 · 2 revisions

An Ogre deployment strategy on Windows Server as a service. This has been successful on Windows Server 2012 R2.

Install prerequisites:

  1. Install Node.
  2. Install the core GDAL libraries. Download gdal-111-1600-x64-core.msi and perform a complete install.
  3. Add GDAL directory (C:\ProgramFiles\GDAL) to PATH environmental variable to both the global PATH and the user PATH (user must be an administrator).
  4. Create a custom environmental variable GDAL_DATA with the path to the gdal_data directory (C:\ProgramFiles\GDAL\gdal_data) to both the global PATH and the user PATH (user must be an administrator).

NOTE: Updating/adding the user environmental variables may or may not be necessary depending on security settings.

Install ogre and node-windows:

  1. Create directory C:\ogre and open Powershell in said directory.
  2. npm install ogre
  3. npm install -g node-windows
  4. npm link node-windows

Create install/uninstall scripts in C:\ogre:

install.js

var Service = require('node-windows').Service;

var svc = new Service({
  name:'Ogre Web Client',
  description: 'Local Ogre Web Client',
  script: 'C:\\ogre\\node_modules\\ogre\\bin\\ogre.js'
});

svc.on('install', function(){
  svc.start();
});

svc.install();

uninstall.js

var Service = require('node-windows').Service;

var svc = new Service({
  name:'Ogre Web Client',
  script: 'C:\\ogre\\node_modules\\ogre\\bin\\ogre.js'
});

svc.on('uninstall', function(){
  console.log('Uninstall complete.');
  console.log('The service exists: ',svc.exists);
});

svc.uninstall();

Run and test:

  1. In C:\ogre run node install.js.
  2. Open http://localhost:3000 or http://SEVER_NAME:3000 in a browser.

Optionally use IIS URL Rewrite to reverse-proxy to an IIS web site URL. If the UI is not needed the convert and convertJson endpoints can each have an independent rewrite rule; in which case be sure the convertJson rule is above the convert rule to avoid the pattern always returning http://my_url/convert.