From: Andy Witter Date: Fri, 8 Jan 2016 16:11:31 +0000 (-0500) Subject: More work on webby add bower and grunt debs and put apache websocket config files... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8bda72f09f5e0e8450f86624a72a0fd4f1ab5463;p=contrib%2Fpines%2Fgenasys.git More work on webby add bower and grunt debs and put apache websocket config files in place --- diff --git a/GenaSYS.sh b/GenaSYS.sh index 0a30d65..90f5619 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -25,8 +25,8 @@ PURPOSE_="Generate config files needed for Evergreen-ILS Cluster" SYNOPSIS_="$NAME_" REQUIRES_="standard GNU commands, apt, dpkg" - VERSION_="1.57" - DATE_="2010-11-23; last update: 2015-12-21" + VERSION_="1.58" + DATE_="2010-11-23; last update: 2016-01-08" AUTHOR_="Andy Witter " URL_="http://evergreen-ils.org" CATEGORY_="devel" @@ -2985,6 +2985,7 @@ do cp $TEMPLATEDIR/monitor/check_memcached.pl ../setup_${SUBFOLDER}/monitoring cp $TEMPLATEDIR/monitor/check_postgres.pl ../setup_${SUBFOLDER}/monitoring cp $TEMPLATEDIR/monitor/check_cpu.sh ../setup_${SUBFOLDER}/monitoring + cp -r $TEMPLATEDIR/apache2/websockets ../setup_${SUBFOLDER} touch ../setup_${SUBFOLDER}/.osrf_node sed -i "s^HOSTNAME^${SUBFOLDER}^g" ../setup_${SUBFOLDER}/debconf-settings diff --git a/templates/apache2/websockets/apache2.conf b/templates/apache2/websockets/apache2.conf new file mode 100644 index 0000000..64e6a4c --- /dev/null +++ b/templates/apache2/websockets/apache2.conf @@ -0,0 +1,78 @@ +# This is the main Apache 2.4 server configuration file for the OpenSRF +# WebSockets gateway. + +Include mods-available/mpm_prefork.load +Include mods-available/mpm_prefork.conf +Include mods-available/access_compat.load +Include mods-available/authz_core.load + +# if we don't want to run as "opensrf", change the LockFile +#LockFile ${APACHE_LOCK_DIR}/accept.lock +Mutex file:${APACHE_LOCK_DIR} default +PidFile ${APACHE_PID_FILE} +User ${APACHE_RUN_USER} +Group ${APACHE_RUN_GROUP} + +DefaultType None +HostnameLookups Off +ErrorLog ${APACHE_LOG_DIR}/error.log +LogLevel warn + +# only affects the initial connection, which should be quick. +Timeout 30 + +# WebSockets is KeepAlive on steroids +KeepAlive Off + + + StartServers 5 + MinSpareServers 5 + MaxSpareServers 20 + # use ServerLimit to raise beyond 256 + MaxClients 256 + MaxRequestsPerChild 0 + + +# include the exact mods we need +Include mods-available/mime.load +Include mods-available/mime.conf +# SSL requires mime +Include mods-available/ssl.load +Include mods-available/ssl.conf +Include mods-available/socache_shmcb.load +Include mods-available/websocket.load + +LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined +LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %O" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent + +# WebSockets via SSL +Listen 7682 + + DocumentRoot /var/www + ServerName localhost:7682 + ServerAlias 127.0.0.1:7682 + SSLEngine on + SSLHonorCipherOrder On + SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM + + # re-use the certs from the main apache instance + SSLCertificateFile /etc/apache2/ssl/server.crt + SSLCertificateKeyFile /etc/apache2/ssl/server.key + + +# WebSockets via non-SSL +Listen 7680 + + ServerName localhost:7680 + ServerAlias 127.0.0.1:7680 + DocumentRoot /var/www + + +# OpenSRF WebSockets gateway + + SetHandler websocket-handler + WebSocketHandler /usr/lib/apache2/modules/osrf_websocket_translator.so osrf_websocket_init + diff --git a/templates/apache2/websockets/envvars b/templates/apache2/websockets/envvars new file mode 100644 index 0000000..97c2695 --- /dev/null +++ b/templates/apache2/websockets/envvars @@ -0,0 +1,5 @@ +export OSRF_WEBSOCKET_IDLE_TIMEOUT=120 +export OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL=5 +export OSRF_WEBSOCKET_CONFIG_FILE=/openils/conf/opensrf_core.xml +export OSRF_WEBSOCKET_CONFIG_CTXT=gateway +export OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME=600 diff --git a/templates/debs/bower_1.4.1_all.deb b/templates/debs/bower_1.4.1_all.deb new file mode 100644 index 0000000..d995981 Binary files /dev/null and b/templates/debs/bower_1.4.1_all.deb differ diff --git a/templates/debs/grunt-cli_0.4.5_all.deb b/templates/debs/grunt-cli_0.4.5_all.deb new file mode 100644 index 0000000..a1ab7c5 Binary files /dev/null and b/templates/debs/grunt-cli_0.4.5_all.deb differ diff --git a/templates/setup-functions b/templates/setup-functions index e0662d9..8b7bf4b 100644 --- a/templates/setup-functions +++ b/templates/setup-functions @@ -47,6 +47,8 @@ if apt-get update gdebi --n librose-uri-perl*.deb gdebi --n libmarc-xml-perl*.deb gdebi --n libbusiness-stripe-perl*.deb + gdebi --n bower*.deb + gdebi --n grunt*.deb echo echo "Installing OpenSRF:";sleep 2 @@ -55,9 +57,17 @@ if apt-get update echo echo "Installing Dependencies for Apache Web Sockets for web based staff client";sleep 2 gdebi --n libapache2-mod-websocket*.deb + echo echo "Setting up Apache Web Sockets for opensrf";sleep 2 service apache2 stop;sleep 2 sh /usr/share/doc/apache2/examples/setup-instance websockets + if [ -e "$WD/websockets" ] + then + echo + echo "Websockets found copying config files..." + sleep 2 + cp -f $WD/websockets/* /etc/apache2/apache2-websockets + fi a2dismod websocket service apache2-websockets start diff --git a/webby.sh b/webby.sh new file mode 100644 index 0000000..0f0d29d --- /dev/null +++ b/webby.sh @@ -0,0 +1,9 @@ +* install opensrf +* install opensrf-websockets + +/etc/init.d/apache2 stop | +sh /usr/share/doc/apache2/examples/setup-instance websockets | +a2dismod websocket | +/etc/init.d/apache2-websockets start + +* install evergreen