UNPKG

3.09 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# run using: source install_cache.sh
4
5# !!! Note: You cannot really use this as a standalone installer script because there are 2
6# manual steps: Downloading and saving a copy of Cache, and saving a copy of your
7# Cache key, both of which you must obtain from InterSystems. If you have these
8# available, modify this script at the places indicated below with !!!
9
10# Prepare
11
12sudo apt-get update
13sudo apt-get install -y build-essential libssl-dev
14sudo apt-get install -y wget gzip openssh-server curl
15
16# Cache
17
18sudo sysctl -w kernel.shmall=536870912
19sudo sysctl -w kernel.shmmax=536870912
20sudo /bin/su -c "echo 'kernel.shmall=536870912' >> /etc/sysctl.conf"
21sudo /bin/su -c "echo 'kernel.shmmax=536870912' >> /etc/sysctl.conf"
22
23# !!! At this point, it's assumed that you've downloaded and saved a copy of
24# a Cache installation file from InterSystems, eg cache-2015.2.tar.gz
25# If you're using Ubuntu, get the build for Suse Linux
26# ... now install it:
27
28mkdir /tmp/cachekit
29cd ~
30gunzip -c cache*.tar.gz | ( cd /tmp/cachekit ; tar xf - )
31cd /tmp/cachekit
32sudo ./cinstall
33
34# Note: when asked for responses:
35# Accept 1 - Suse Linux
36# Accept instance name of CACHE
37# Installation directory assumed to be /opt/cache
38# Accept 1 - Development server
39# Say yes to Unicode
40# Accept Minimal Security settings (1)
41# If using EC2, group to use is ubuntu
42# Accept No to license - install your own later into /opt/cache/mgr
43# Then accept settings
44
45
46# Cache key
47
48cd /opt/cache/mgr
49
50# !!! At this point you copy your cache.key into this directory
51# and then restart Cache:
52
53ccontrol stop cache restart quietly
54
55# Node.js v6.x
56
57# Install NVM
58
59cd ~
60curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
61export NVM_DIR="$HOME/.nvm"
62[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
63nvm install 6
64
65sudo ln -s /usr/local/bin/node /usr/bin/node
66sudo ln -s /usr/local/lib/node /usr/lib/node
67sudo ln -s /usr/local/bin/npm /usr/bin/npm
68sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
69n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
70
71# Now install ewd-xpress and its peer dependencies
72# First create a parent directory for all your EWD 3 work, eg ~/qewd
73
74cd ~
75mkdir qewd
76cd qewd
77
78npm install qewd qewd-monitor
79
80# Note: QEWD will install all its peer dependencies. Ignore the warnings from NPM!
81
82# cache.node
83
84cd ~/qewd/node_modules
85
86# You'll need a compatible copy of the cache.node interface file, ie in our case, cache610.node:
87# rename it to cache.node:
88
89mv cache610.node cache.node
90
91# Finally move various files into place:
92
93mv ~/qewd/node_modules/qewd/example/qewd.js ~/qewd/qewd.js
94
95cd ~/qewd
96mkdir www
97cd www
98mkdir qewd-monitor
99cp ~/qewd/node_modules/qewd-monitor/www/bundle.js ~/qewd/www/qewd-monitor
100cp ~/qewd/node_modules/qewd-monitor/www/*.html ~/qewd/www/qewd-monitor
101cp ~/qewd/node_modules/qewd-monitor/www/*.css ~/qewd/www/qewd-monitor
102
103cd ~/qewd
104
105echo 'Done!'
106
107# QEWD can be started using sudo node qewd
108