source: trunk/gsdl3/gs3-finalise.sh@ 6460

Last change on this file since 6460 was 6459, checked in by kjdon, 20 years ago

now edits the soap deployment script

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1#!/bin/sh
2
3## gs3-finalise.sh -- Install Greenstone 3
4
5#check that GSDL3HOME is set
6if test -z "$GSDL3HOME" ; then
7 echo "You need to 'source gs3-setup.sh' before running this script"
8 exit;
9fi
10gsdl3home=$GSDL3HOME
11# Prompt for the computer name
12hostname="localhost"
13echo ""
14echo "Enter the full address of the host computer from which the greenstone"
15echo "collections will be served, for example:"
16echo "bob.greenstone.ac.nz"
17echo "or press enter for default [Default = localhost]."
18echo ""
19printf "%s" "> "
20read ans
21if [ "$ans" != "" ] ; then
22 hostname="$ans"
23fi
24
25# Prompt for the port number
26portnumber="8080"
27echo ""
28echo "Enter the port number that the tomcat webserver will serve on,"
29echo "or press enter for default [Default = 8080]."
30echo ""
31printf "%s" "> "
32read ans
33if [ "$ans" != "" ] ; then
34 portnumber="$ans"
35fi
36
37# Edit the comms/jakata/tomcat/conf/server.xml file and set the gsdl3home and hostname variables
38sed "s|@gsdl3home@|${gsdl3home}|" ./comms/jakarta/tomcat/conf/server.xml.in > ./comms/jakarta/tomcat/conf/server.xml
39if [ "$portnumber" != "8080" ] ; then
40 sed "s|8080|${portnumber}|" ./comms/jakarta/tomcat/conf/server.xml > ./comms/jakarta/tomcat/conf/server.tmp && mv ./comms/jakarta/tomcat/conf/server.tmp ./comms/jakarta/tomcat/conf/server.xml
41fi
42
43# Edit the web/WEB-INF/web.xml to set gsdl3home
44sed "s|@gsdl3home@|${gsdl3home}|" ./web/WEB-INF/web.xml.in > ./web/WEB-INF/web.xml
45
46# Edit the siteConfig.xml found in any site within the sites folder
47for SITE in $gsdl3home/web/sites/*; do
48 if [ -f $SITE/siteConfig.xml ] ; then
49 echo "Processing $SITE"
50 if [ "$hostname" != "localhost" ] ; then
51 sed "s|localhost|${hostname}|" $SITE/siteConfig.xml > $SITE/siteConfig.tmp && mv $SITE/siteConfig.tmp $SITE/siteConfig.xml
52 fi
53 if [ "$portnumber" != "8080" ] ; then
54 sed "s|8080|${portnumber}|" $SITE/siteConfig.xml > $SITE/siteConfig.tmp && mv $SITE/siteConfig.tmp $SITE/siteConfig.xml
55 fi
56 fi
57done
58
59# set up the sql db
60pushd $GSDL3HOME/packages/mysql
61./bin/mysql_install_db
62#./bin/mysql_safe &
63./bin/mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
64./bin/mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
65#./bin/mysqladmin shutdown
66popd
67
68
69# We also edit the GSDL3 launching script and the SOAP deployment script
70if [ "$hostname" != "localhost" ] ; then
71 sed "s|localhost|${hostname}|" gs3-launch.sh > gs3-launch.tmp && mv gs3-launch.tmp gs3-launch.sh
72 sed "s|localhost|${hostname}|" gs3-soap-deploy-site.sh > gs3-soap.tmp && mv gs3-soap.tmp gs3-soap-deploy-site.sh
73
74fi
75if [ "$portnumber" != "8080" ] ; then
76 sed "s|8080|${portnumber}|" gs3-launch.sh > gs3-launch.tmp && mv gs3-launch.tmp gs3-launch.sh
77 sed "s|8080|${portnumber}|" gs3-soap-deploy-site.sh > gs3-soap.tmp && mv gs3-soap.tmp gs3-soap-deploy-site.sh
78fi
79
80# Make the GSDL3 script executable
81chmod a+x gs3-launch.sh
82chmod a+x gs3-soap-deploy-site.sh
83
84# And provide a nice little postscript
85echo ""
86echo "****************************************************************"
87echo "Greenstone 3 - Installation Complete!"
88echo ""
89echo "Change to the folder denoted below and run gs3-launch.sh to start the"
90echo "web server:"
91echo ""
92echo " $GSDL3HOME"
93echo ""
94echo "****************************************************************"
95echo ""
96
97exit 0
Note: See TracBrowser for help on using the repository browser.