1 |
|
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 |
|
12 | sudo apt-get update
|
13 | sudo apt-get install -y build-essential libssl-dev
|
14 | sudo apt-get install -y wget gzip openssh-server curl
|
15 |
|
16 | # Cache
|
17 |
|
18 | sudo sysctl -w kernel.shmall=536870912
|
19 | sudo sysctl -w kernel.shmmax=536870912
|
20 | sudo /bin/su -c "echo 'kernel.shmall=536870912' >> /etc/sysctl.conf"
|
21 | sudo /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 |
|
28 | mkdir /tmp/cachekit
|
29 | cd ~
|
30 | gunzip -c cache*.tar.gz | ( cd /tmp/cachekit ; tar xf - )
|
31 | cd /tmp/cachekit
|
32 | sudo ./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 |
|
48 | cd /opt/cache/mgr
|
49 |
|
50 | # !!! At this point you copy your cache.key into this directory
|
51 | # and then restart Cache:
|
52 |
|
53 | ccontrol stop cache restart quietly
|
54 |
|
55 | # Node.js v6.x
|
56 |
|
57 | # Install NVM
|
58 |
|
59 | cd ~
|
60 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
|
61 | export NVM_DIR="$HOME/.nvm"
|
62 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
63 | nvm install 6
|
64 |
|
65 | sudo ln -s /usr/local/bin/node /usr/bin/node
|
66 | sudo ln -s /usr/local/lib/node /usr/lib/node
|
67 | sudo ln -s /usr/local/bin/npm /usr/bin/npm
|
68 | sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
|
69 | n=$(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 |
|
74 | cd ~
|
75 | mkdir qewd
|
76 | cd qewd
|
77 |
|
78 | npm install qewd qewd-monitor
|
79 |
|
80 | # Note: QEWD will install all its peer dependencies. Ignore the warnings from NPM!
|
81 |
|
82 | # cache.node
|
83 |
|
84 | cd ~/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 |
|
89 | mv cache610.node cache.node
|
90 |
|
91 | # Finally move various files into place:
|
92 |
|
93 | mv ~/qewd/node_modules/qewd/example/qewd.js ~/qewd/qewd.js
|
94 |
|
95 | cd ~/qewd
|
96 | mkdir www
|
97 | cd www
|
98 | mkdir qewd-monitor
|
99 | cp ~/qewd/node_modules/qewd-monitor/www/bundle.js ~/qewd/www/qewd-monitor
|
100 | cp ~/qewd/node_modules/qewd-monitor/www/*.html ~/qewd/www/qewd-monitor
|
101 | cp ~/qewd/node_modules/qewd-monitor/www/*.css ~/qewd/www/qewd-monitor
|
102 |
|
103 | cd ~/qewd
|
104 |
|
105 | echo 'Done!'
|
106 |
|
107 | # QEWD can be started using sudo node qewd
|
108 |
|