TMG EWD / Node.js configuration: Difference between revisions
Created page with "Below will be a description of the EWD setup used at the TMG Site (Kevin Toppenberg's office) [https://groups.google.com/forum/#!topic/ewd-and-vista/nSua-leSCV0 Here] are som..." |
No edit summary |
||
| Line 5: | Line 5: | ||
Below is the resulting directory structure | Below is the resulting directory structure | ||
/opt/ewdlite/ | /opt/ewdlite/ | ||
├── node_modules | ├── node_modules | ||
│ ├── ewdgateway2 | │ ├── ewdgateway2 | ||
| Line 16: | Line 12: | ||
│ │ │ ├── ewdapps | │ │ │ ├── ewdapps | ||
│ │ │ │ └── ewdGateway2 | │ │ │ │ └── ewdGateway2 | ||
│ │ │ │ ├── js | |||
│ │ │ │ └── node | |||
│ │ │ │ └── ewdGateway2 | |||
│ │ │ │ └── examples | |||
│ │ │ └── startupExamples | │ │ │ └── startupExamples | ||
│ │ ├── ewdLite | │ │ ├── ewdLite | ||
│ │ │ ├── mongoDB | │ │ │ ├── mongoDB | ||
│ │ │ │ └── node-0.10 | │ │ │ │ └── node-0.10 | ||
│ │ │ │ ├── linux32 | |||
│ │ │ │ ├── linux64 | |||
│ │ │ │ ├── raspberryPi | |||
│ │ │ │ └── winx64 | |||
│ │ │ ├── node_modules | │ │ │ ├── node_modules | ||
│ │ │ ├── OSEHRA | │ │ │ ├── OSEHRA | ||
| Line 26: | Line 30: | ||
│ │ │ └── www | │ │ │ └── www | ||
│ │ │ ├── ewd | │ │ │ ├── ewd | ||
│ │ │ │ ├── bootstrap3 | |||
│ │ │ │ ├── ewdEncrypter | |||
│ │ │ │ ├── ewdGDSync | |||
│ │ │ │ ├── ewdMonitor | |||
│ │ │ │ ├── VistADemo | |||
│ │ │ │ └── webSvcMgr | |||
│ │ │ ├── ewdLite | │ │ │ ├── ewdLite | ||
│ │ │ └── respond | │ │ │ └── respond | ||
| Line 34: | Line 44: | ||
│ │ ├── benchmarks | │ │ ├── benchmarks | ||
│ │ ├── lib | │ │ ├── lib | ||
│ │ │ ├── stores | |||
│ │ │ └── transports | |||
│ │ │ └── websocket | |||
│ │ └── node_modules | │ │ └── node_modules | ||
│ │ ├── base64id | |||
│ │ │ └── lib | |||
│ │ ├── policyfile | |||
│ │ │ ├── doc | |||
│ │ │ ├── examples | |||
│ │ │ ├── lib | |||
│ │ │ └── tests | |||
│ │ │ └── ssl | |||
│ │ ├── redis | |||
│ │ │ ├── benches | |||
│ │ │ │ └── stress | |||
│ │ │ │ ├── pubsub | |||
│ │ │ │ ├── rpushblpop | |||
│ │ │ │ └── speed | |||
│ │ │ ├── examples | |||
│ │ │ └── lib | |||
│ │ │ └── parser | |||
│ │ └── socket.io-client | |||
│ │ ├── bin | |||
│ │ ├── components | |||
│ │ │ ├── component-bind | |||
│ │ │ ├── component-emitter | |||
│ │ │ ├── component-json | |||
│ │ │ ├── component-json-fallback | |||
│ │ │ ├── learnboost-engine.io-client | |||
│ │ │ │ └── lib | |||
│ │ │ │ └── transports | |||
│ │ │ ├── learnboost-socket.io-protocol | |||
│ │ │ ├── timoxley-to-array | |||
│ │ │ └── visionmedia-debug | |||
│ │ ├── dist | |||
│ │ ├── lib | |||
│ │ │ ├── transports | |||
│ │ │ └── vendor | |||
│ │ │ └── web-socket-js | |||
│ │ │ └── flash-src | |||
│ │ │ └── com | |||
│ │ │ ├── adobe | |||
│ │ │ │ └── net | |||
│ │ │ │ └── proxies | |||
│ │ │ ├── gsolo | |||
│ │ │ │ └── encryption | |||
│ │ │ └── hurlant | |||
│ │ │ ├── crypto | |||
│ │ │ │ ├── cert | |||
│ │ │ │ ├── hash | |||
│ │ │ │ ├── prng | |||
│ │ │ │ ├── rsa | |||
│ │ │ │ ├── symmetric | |||
│ │ │ │ ├── tests | |||
│ │ │ │ └── tls | |||
│ │ │ ├── math | |||
│ │ │ └── util | |||
│ │ │ └── der | |||
│ │ ├── node_modules | |||
│ │ │ ├── active-x-obfuscator | |||
│ │ │ │ └── node_modules | |||
│ │ │ │ └── zeparser | |||
│ │ │ ├── uglify-js | |||
│ │ │ │ ├── bin | |||
│ │ │ │ ├── lib | |||
│ │ │ │ ├── test | |||
│ │ │ │ │ └── unit | |||
│ │ │ │ │ └── compress | |||
│ │ │ │ │ ├── expected | |||
│ │ │ │ │ └── test | |||
│ │ │ │ └── tmp | |||
│ │ │ ├── ws | |||
│ │ │ │ ├── bench | |||
│ │ │ │ ├── bin | |||
│ │ │ │ ├── build | |||
│ │ │ │ │ └── Release | |||
│ │ │ │ │ └── obj.target | |||
│ │ │ │ │ ├── bufferutil | |||
│ │ │ │ │ │ └── src | |||
│ │ │ │ │ └── validation | |||
│ │ │ │ │ └── src | |||
│ │ │ │ ├── doc | |||
│ │ │ │ ├── examples | |||
│ │ │ │ │ ├── fileapi | |||
│ │ │ │ │ │ └── public | |||
│ │ │ │ │ ├── serverstats | |||
│ │ │ │ │ │ └── public | |||
│ │ │ │ │ └── serverstats-express_3 | |||
│ │ │ │ │ └── public | |||
│ │ │ │ ├── lib | |||
│ │ │ │ ├── node_modules | |||
│ │ │ │ │ ├── commander | |||
│ │ │ │ │ │ └── lib | |||
│ │ │ │ │ ├── nan | |||
│ │ │ │ │ ├── options | |||
│ │ │ │ │ │ ├── lib | |||
│ │ │ │ │ │ └── test | |||
│ │ │ │ │ │ └── fixtures | |||
│ │ │ │ │ └── tinycolor | |||
│ │ │ │ ├── src | |||
│ │ │ │ └── test | |||
│ │ │ │ └── fixtures | |||
│ │ │ └── xmlhttprequest | |||
│ │ │ ├── example | |||
│ │ │ ├── lib | |||
│ │ │ └── tests | |||
│ │ └── test | |||
│ │ └── node | |||
│ ├── ewdliteclient | │ ├── ewdliteclient | ||
│ │ └── lib | │ │ └── lib | ||
| Line 43: | Line 160: | ||
│ └── src | │ └── src | ||
├── ssl | ├── ssl | ||
└── www | └── www | ||
├── ewd | ├── ewd | ||
| Line 54: | Line 170: | ||
├── ewdLite | ├── ewdLite | ||
└── respond | └── respond | ||
And below is '''/opt/ewdlite/ewdStart-globals-http.js''' (And for FYI, that port 8080 is not exposed to the internet.) | And below is '''/opt/ewdlite/ewdStart-globals-http.js''' (And for FYI, that port 8080 is not exposed to the internet.) | ||
Revision as of 23:20, 25 March 2014
Below will be a description of the EWD setup used at the TMG Site (Kevin Toppenberg's office)
Here are some notes made during installation and in this thread:
Below is the resulting directory structure
/opt/ewdlite/
├── node_modules
│ ├── ewdgateway2
│ │ ├── ewd-classic
│ │ │ ├── ewdapps
│ │ │ │ └── ewdGateway2
│ │ │ │ ├── js
│ │ │ │ └── node
│ │ │ │ └── ewdGateway2
│ │ │ │ └── examples
│ │ │ └── startupExamples
│ │ ├── ewdLite
│ │ │ ├── mongoDB
│ │ │ │ └── node-0.10
│ │ │ │ ├── linux32
│ │ │ │ ├── linux64
│ │ │ │ ├── raspberryPi
│ │ │ │ └── winx64
│ │ │ ├── node_modules
│ │ │ ├── OSEHRA
│ │ │ ├── ssl
│ │ │ ├── startupExamples
│ │ │ └── www
│ │ │ ├── ewd
│ │ │ │ ├── bootstrap3
│ │ │ │ ├── ewdEncrypter
│ │ │ │ ├── ewdGDSync
│ │ │ │ ├── ewdMonitor
│ │ │ │ ├── VistADemo
│ │ │ │ └── webSvcMgr
│ │ │ ├── ewdLite
│ │ │ └── respond
│ │ ├── examples
│ │ ├── lib
│ │ └── node_modules
│ │ └── socket.io
│ │ ├── benchmarks
│ │ ├── lib
│ │ │ ├── stores
│ │ │ └── transports
│ │ │ └── websocket
│ │ └── node_modules
│ │ ├── base64id
│ │ │ └── lib
│ │ ├── policyfile
│ │ │ ├── doc
│ │ │ ├── examples
│ │ │ ├── lib
│ │ │ └── tests
│ │ │ └── ssl
│ │ ├── redis
│ │ │ ├── benches
│ │ │ │ └── stress
│ │ │ │ ├── pubsub
│ │ │ │ ├── rpushblpop
│ │ │ │ └── speed
│ │ │ ├── examples
│ │ │ └── lib
│ │ │ └── parser
│ │ └── socket.io-client
│ │ ├── bin
│ │ ├── components
│ │ │ ├── component-bind
│ │ │ ├── component-emitter
│ │ │ ├── component-json
│ │ │ ├── component-json-fallback
│ │ │ ├── learnboost-engine.io-client
│ │ │ │ └── lib
│ │ │ │ └── transports
│ │ │ ├── learnboost-socket.io-protocol
│ │ │ ├── timoxley-to-array
│ │ │ └── visionmedia-debug
│ │ ├── dist
│ │ ├── lib
│ │ │ ├── transports
│ │ │ └── vendor
│ │ │ └── web-socket-js
│ │ │ └── flash-src
│ │ │ └── com
│ │ │ ├── adobe
│ │ │ │ └── net
│ │ │ │ └── proxies
│ │ │ ├── gsolo
│ │ │ │ └── encryption
│ │ │ └── hurlant
│ │ │ ├── crypto
│ │ │ │ ├── cert
│ │ │ │ ├── hash
│ │ │ │ ├── prng
│ │ │ │ ├── rsa
│ │ │ │ ├── symmetric
│ │ │ │ ├── tests
│ │ │ │ └── tls
│ │ │ ├── math
│ │ │ └── util
│ │ │ └── der
│ │ ├── node_modules
│ │ │ ├── active-x-obfuscator
│ │ │ │ └── node_modules
│ │ │ │ └── zeparser
│ │ │ ├── uglify-js
│ │ │ │ ├── bin
│ │ │ │ ├── lib
│ │ │ │ ├── test
│ │ │ │ │ └── unit
│ │ │ │ │ └── compress
│ │ │ │ │ ├── expected
│ │ │ │ │ └── test
│ │ │ │ └── tmp
│ │ │ ├── ws
│ │ │ │ ├── bench
│ │ │ │ ├── bin
│ │ │ │ ├── build
│ │ │ │ │ └── Release
│ │ │ │ │ └── obj.target
│ │ │ │ │ ├── bufferutil
│ │ │ │ │ │ └── src
│ │ │ │ │ └── validation
│ │ │ │ │ └── src
│ │ │ │ ├── doc
│ │ │ │ ├── examples
│ │ │ │ │ ├── fileapi
│ │ │ │ │ │ └── public
│ │ │ │ │ ├── serverstats
│ │ │ │ │ │ └── public
│ │ │ │ │ └── serverstats-express_3
│ │ │ │ │ └── public
│ │ │ │ ├── lib
│ │ │ │ ├── node_modules
│ │ │ │ │ ├── commander
│ │ │ │ │ │ └── lib
│ │ │ │ │ ├── nan
│ │ │ │ │ ├── options
│ │ │ │ │ │ ├── lib
│ │ │ │ │ │ └── test
│ │ │ │ │ │ └── fixtures
│ │ │ │ │ └── tinycolor
│ │ │ │ ├── src
│ │ │ │ └── test
│ │ │ │ └── fixtures
│ │ │ └── xmlhttprequest
│ │ │ ├── example
│ │ │ ├── lib
│ │ │ └── tests
│ │ └── test
│ │ └── node
│ ├── ewdliteclient
│ │ └── lib
│ └── nodem
│ ├── examples
│ ├── lib
│ ├── resources
│ └── src
├── ssl
└── www
├── ewd
│ ├── bootstrap3
│ ├── ewdEncrypter
│ ├── ewdGDSync
│ ├── ewdMonitor
│ ├── VistADemo
│ └── webSvcMgr
├── ewdLite
└── respond
And below is /opt/ewdlite/ewdStart-globals-http.js (And for FYI, that port 8080 is not exposed to the internet.)
var ewd = require('ewdgateway2');
var params = {
lite: true,
poolSize: 2,
httpPort: 8080,
https: {
enabled: false
},
database: {
type: 'gtm',
nodePath: "/opt/ewdlite/node_modules/nodem/lib/mumps.node",
},
lite: true,
modulePath: '/opt/ewdlite/node_modules',
traceLevel: 3,
webServerRootPath: '/opt/ewdlite/www',
logFile: 'ewdLog.txt',
management: {
password: 'xxxxxxxx' #<redacted>
}
};
ewd.start(params);
Below is /etc/init/ewdlite.conf This causes EWD to automatically come up with each server reboot. Notice the modifications made, marked by #//kt. Notice that setup_env is sourced into this script.
description "ewdlite server" author "Mike Clayton on behalf of http://mgateway.com" start on started mountall stop on shutdown # Automatically Respawn: respawn respawn limit 10 5 script # Not sure why $HOME is needed, but we found that it is: export HOME="/opt/ewdlite" #//kt --- start mod ---- . /opt/worldvista/EHR/bin/setup_env echo "Starting ewdlist server at" $(date) >> /tmp/ewdlite_service.log echo "gtm_dist: " $gtm_dist >> /tmp/ewdlite_service.log #//kt --- end mod --- exec /usr/local/bin/node /opt/ewdlite/ewdStart-globals.js >> /var/log/ewdlite.log 2>&1 end script post-start script # Optionally put a script here that will notifiy you node has (re)started end script
Below is /opt/worldvista/EHR/bin/setup_env used to established environmental variables. The parts we had to add to this startup script, when setting up EWD, are the lines for exporting node_home, and GTMCI, and we modified the line exporting gtmroutines to include the source files for Node.
#!/bin/sh
##
echo "Starting Setup_env script"
export GTM_REPLICATION=off
export vista_home="/opt/worldvista/EHR"
$vista_home/bin/env
echo "vista_home="$vista_home
export VH=${vista_home} # a short name for paths, etc - temp
echo "VH="$VH
export gtm_dist="${VH}/m"
echo "gtm_dist="$gtm_dist
export gtm_prompt="ASTRON>"
export node_home="/opt/ewdlite/node_modules/nodem"
export GTMCI="${node_home}/resources/calltab.ci"
#export gtm_sysid="xxxx"
export gtm_log="${VH}/log"
export gtmgbldir="${VH}/g/mumps.gld"
export gtmroutines="${VH}/o(${VH}/p ${VH}/r ${node_home}/src)"
export gtmroutines="${gtmroutines} ${gtm_dist}"
export gtm_zinterrupt='I $$JOBEXAM^ZU($ZPOSITION)'
# MD5 Library external-call table
#export GTMXC_md5="${VH}/w/xc/gtm_md5.xc"
##
export PATH="${VH}/m:${PATH}"
unset VH
###
# Define command aliases
alias GTM="${gtm_dist}/mumps -direct"
alias gtm="${gtm_dist}/mumps -direct"
alias mupip="${gtm_dist}/mupip"
alias gde="${gtm_dist}/mumps -run ^GDE"
alias GDE="${gtm_dist}/mumps -run ^GDE"
alias lke="${gtm_dist}/lke"
alias dse="${gtm_dist}/dse"
alias LKE="${gtm_dist}/lke"
alias DSE="${gtm_dist}/dse"
alias rundown="${gtm_dist}/mupip rundown -r \"*\""
So that's it. We had a successful test with the above files.
Kevin Toppenberg