]> git.evergreen-ils.org Git - OpenSRF.git/blob - README.websockets
LP#1268619: websockets: shared worker path; JS api_level
[OpenSRF.git] / README.websockets
1
2 Websockets installation instructions for Debian:
3
4 # TODO: Most of this can be scripted.
5 # TODO: Better handling of external dependencies (websocket_plugin.h).  
6
7 # as root
8
9 # see also /usr/share/doc/apache2/README.multiple-instances
10 % sh /usr/share/doc/apache2.2-common/examples/setup-instance websockets
11
12 % cp examples/apache2/websockets.conf /etc/apache2-websockets/sites-available/
13
14 # activate the websockets configuration
15 % a2ensite-websockets websockets.conf 
16
17 # deactivate the default site
18 % a2dissite-websockets default 
19
20 # remove most of the mods with this shell script
21
22 MODS=$(apache2ctl-websockets -M | grep shared | grep -v 'Syntax OK' | sed 's/_module//g' | cut -d' ' -f2 | xargs);
23 for mod in $MODS; do
24     if [ $mod = 'mime' -o $mod = 'ssl' -o $mod = 'websocket' ]; then
25         echo "* Leaving module $mod in place";
26     else
27         echo "* Disabling module $mod";
28         a2dismod-websockets $mod;
29     fi;
30 done
31
32 # follow the instructions for installing Apache mod_websockets at
33 # https://github.com/disconnect/apache-websocket
34
35 # copy the headers into place so OpenSRF can compile
36 % cp $LOCATION_OF_APACHE_WEBSOCKET_CHECKOUT/websocket_plugin.h src/gateway/
37
38 # install OpenSRF
39
40 # remove the websocket module from the default OpenSRF Apache instance
41 % a2dismod osrf_websocket_translator
42
43 # optional: add these configuration variables to 
44 # /etc/init.d/apache2-websockets/envvars and adjust as needed.
45 # export OSRF_WEBSOCKET_IDLE_TIMEOUT=60
46 # export OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL=5
47 # export OSRF_WEBSOCKET_CONFIG_FILE=/openils/conf/opensrf_core.xml
48 # export OSRF_WEBSOCKET_CONFIG_CTXT=gateway
49 #
50 # IDLE_TIMEOUT specifies how long we will allow a client to stay connected
51 # while idle.  A longer timeout means less network traffic (from fewer
52 # websocket CONNECT calls), but it also means more Apache processes are 
53 # tied up doing nothing.
54 #
55 # IDLE_CHECK_INTERVAL specifies how often we wake to check the idle status
56 # of the connected client.
57 #
58 # Both specified in seconds
59 #
60 # CONFIG_FILE / CTXT are the standard opensrf core config options.
61
62 # After OpenSRF is up and running, fire up the secondary Apache instance
63 # errors will appear in /var/log/apache2-websockets/error.log
64 % /etc/init.d/apache2-websockets restart
65
66