source: gs3-extensions/solr/trunk/src/gs3-setup.sh@ 35315

Last change on this file since 35315 was 35315, checked in by davidb, 3 years ago

Some refinement of the (echo) messages generated so the information presented in general doesn't sound quite so scary, when things are in fact still on track

File size: 3.1 KB
Line 
1
2extdesc="the Solr Extension"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir=${full_setup%/*}
6fulldir=${fulldir%/.}
7
8#--
9# Edit the following two port values if they conflict with
10# with existing services on your computer
11#--
12
13# If using tomcat, read the tomcat host and port from the toplevel GS3 build.properties
14# http://en.kioskea.net/faq/1757-how-to-read-a-file-line-by-line
15# The following sets the field separator IFS to the = sign, then reads the file line by
16# line, setting propname and propval (which are fields separated by '=') for each line read
17SOLR_PORT=8383
18SOLR_HOST=127.0.0.1
19file=$GSDL3SRCHOME/build.properties
20# The Solr servlet should only be locally accessible, thus restricting the protocol to http as
21# https certificates can't be issued for localhost/127.0.0.1 (https://letsencrypt.org/docs/certificates-for-localhost/)
22# This means we use the properties localhost.server.http (defaults to 127.0.0.1) and localhost.port.http
23# to construct the solr servlet url, rather than properties tomcat.server and tomcat.port.https
24while IFS== read propname propval; do
25 if [ "x$propname" = "xlocalhost.server.http" ] ; then
26 SOLR_HOST=$propval
27 fi
28 if [ "x$propname" = "xlocalhost.port.http" ] ; then
29 SOLR_PORT=$propval
30 fi
31done < $file
32
33#echo "SOLR port: $SOLR_PORT"
34#echo "SOLR host: $SOLR_HOST"
35echo " - Solr API accessed internally via: http://$SOLR_HOST:$SOLR_PORT/solr/"
36
37## If using jetty:
38## The port Jetty runs on:
39#SOLR_JETTY_PORT=8983
40
41## The port Jetty listens on for a "stop" command
42#JETTY_STOP_PORT=8079
43
44
45if test -z $GSDLOS ; then
46 GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
47 # check for running bash under Cygwin
48 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
49 then
50 GSDLOS=windows
51 fi
52 # check for running bash under MinGW/MSys
53 if test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ;
54 then
55 GSDLOS=windows
56 fi
57 echo "GSDLOS was not set. Setting it to '$GSDLOS'"
58 export GSDLOS
59fi
60
61#first_time=0;
62
63if [ "x$GEXT_SOLR" = "x" ] ; then
64 echo "+ Setting up your environment for $extdesc ..."
65 export GEXT_SOLR=`pwd`
66
67 if [ -d "$GEXT_SOLR/bin/script" ] ; then
68 export PATH=$GEXT_SOLR/bin/script:$PATH
69 fi
70
71 if [ -d "$GEXT_SOLR/lib" ] ; then
72 if [ "$GSDLOS" = "linux" ] ; then
73 export LD_LIBRARY_PATH=$GEXT_SOLR/lib:$LD_LIBRARY_PATH
74 elif [ "$GSDLOS" = "darwin" ] ; then
75 export DYLD_LIBRARY_PATH=$GEXT_SOLR/lib:$DYLD_LIBRARY_PATH
76 fi
77 fi
78
79 extdir=${GEXT_SOLR##*/}
80
81 if [ "x$GSDL3EXTS" = "x" ] ; then
82 export GSDL3EXTS=$extdir
83 else
84 export GSDL3EXTS=$GSDL3EXTS:$extdir
85 fi
86
87# export SOLR_JETTY_PORT
88# export JETTY_STOP_PORT
89 export SOLR_PORT
90 export SOLR_HOST
91# first_time=1
92
93 echo "+ ... Your environment is now setup for $extdesc"
94else
95 echo "+ Your environment is already setup for $extdesc"
96fi
97
98#echo "++Solr/Jetty server will run on port $SOLR_JETTY_PORT (+ port $JETTY_STOP_PORT for shutdown command)"
99
100#if [ "$first_time" = "1" ] ; then
101# echo "++Solr will run off the tomcat server on port $SOLR_PORT. "
102# echo "-- This port value can be changed by editing tomcat.port in build.properties"
103# echo ""
104#fi
Note: See TracBrowser for help on using the repository browser.