-
Notifications
You must be signed in to change notification settings - Fork 79
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:
- Install Node.
- Install the core GDAL libraries. Download
gdal-111-1600-x64-core.msi
and perform a complete install. - Add GDAL directory (
C:\ProgramFiles\GDAL
) to PATH environmental variable to both the global PATH and the user PATH (user must be an administrator). - Create a custom environmental variable
GDAL_DATA
with the path to thegdal_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:
- Create directory
C:\ogre
and open Powershell in said directory. npm install ogre
npm install -g node-windows
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:
- In
C:\ogre
runnode install.js
. - Open
http://localhost:3000
orhttp://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
.