source: trunk/gsdl/Install.sh@ 2250

Last change on this file since 2250 was 2250, checked in by sjboddie, 23 years ago

Unix install script now keeps a log of how the installation progressed

  • Property svn:executable set to *
  • Property svn:mime-type set to application/octet-stream
File size: 22.5 KB
Line 
1#!/bin/sh
2
3## Install.sh -- Install Greenstone
4
5cmd_cp="cp"
6cmd_cpr="cp -r"
7cmd_chmod="chmod"
8cmd_mkdir="mkdir -p"
9cmd_ln="ln -s"
10cmd_mv="mv"
11cmd_rm="rm -i"
12cmd_rmr="rm -r"
13
14thisdir=`pwd`
15cd ..
16cd_dir=`pwd`
17cd "$thisdir"
18
19# script must be run from within cdrom/unix directory
20if [ ! -f "${thisdir}/Install.sh" ]; then
21 echo "Install.sh must be run from the directory in which it resides"
22 echo "Greenstone was not installed"
23 exit 1
24fi
25
26# check that various important directories are on the cd
27if [ ! -d "${cd_dir}/gsdl" ]; then
28 echo
29 echo "ERROR: Could not locate ${cd_dir}/gsdl"
30 echo "Greenstone was not installed"
31 exit 1
32fi
33if [ ! -d "${cd_dir}/Unix/bin/linux" ]; then
34 echo
35 echo "ERROR: Could not locate ${cd_dir}/Unix/bin/linux"
36 echo "Greenstone was not installed"
37 exit 1
38fi
39
40
41# install to /usr/local by default if user is "root", otherwise
42# default to users home directory
43gsdlos=`uname | tr A-Z a-z`
44if [ "$gsdlos" = "linux" ]; then
45 logname=`whoami`
46else
47 logname=""
48fi
49if [ "$logname" = "" ]; then
50 logname=`logname`
51fi
52gsdlhome="/home/${logname}"
53if [ "$logname" = "root" ]; then
54 gsdlhome="/usr/local"
55fi
56
57# get gsdlhome
58echo
59echo "This script will install Greenstone on your system. You may want"
60echo "to skim through the Install.pdf document that resides in the docs"
61echo "directory of this cd-rom before continuing with the installation."
62echo
63echo "Note that when prompted for input, hitting \"enter\" will select"
64echo "the default (given in square brackets [] at the end of each question)."
65echo
66echo "Note also that Install.sh prints out information on any commands"
67echo "it runs on your system in the form \"--> Install.sh: [command]\"."
68echo
69echo "It is assumed throughout this installation procedure that you"
70echo "have a webserver installed on your system."
71echo
72echo "For later reference the output of this install script will be"
73echo "recorded in a file called INSTALL_RECORD in the directory into"
74echo "which you choose to install Greenstone."
75echo
76echo "Continue? [y]"
77printf "%s" "> "
78read ans
79if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
80 echo "Greenstone was not installed"
81 exit 0
82fi
83
84echo
85echo "Enter directory to install Greenstone into. A gsdl directory"
86echo "will be created in this directory. [${gsdlhome}]"
87printf "%s" "> "
88read ans
89if [ "$ans" != "" ]; then
90 gsdlhome="$ans"
91fi
92
93if [ ! -d "$gsdlhome" ]; then
94 echo "Warning: The ${gsdlhome} directory does not exist."
95 echo "Create it? [y]"
96 printf "%s" "> "
97 read ans
98 if [ "$ans" = "" ]; then
99 ans="y"
100 fi
101 if [ "$ans" = "y" ]; then
102 echo "--> Install.sh: [$cmd_mkdir \"$gsdlhome\"]"
103 $cmd_mkdir "$gsdlhome"
104 if [ ! -d "$gsdlhome" ]; then
105 echo "ERROR: failed to create $gsdlhome directory"
106 echo "Greenstone was not installed"
107 exit 1
108 fi
109 else
110 echo "Greenstone was not installed"
111 exit 0
112 fi
113fi;
114
115# from now on $gsdlhome includes the "/gsdl"
116gsdlhome="${gsdlhome}/gsdl"
117
118echo "--> Install.sh: [$cmd_mkdir \"${gsdlhome}\"]"
119$cmd_mkdir "$gsdlhome"
120if [ ! -d "$gsdlhome" ]; then
121 echo "ERROR: failed to create $gsdlhome directory"
122 echo "Greenstone was not installed"
123 exit 1
124fi
125# set permissions on gsdlhome directory (not that we should need to)
126echo "--> Install.sh: [$cmd_chmod u+rwx \"${gsdlhome}\"]"
127$cmd_chmod u+rwx "$gsdlhome"
128
129# start the INSTALL_RECORD script
130echo
131echo "** Starting installation record at ${gsdlhome}/INSTALL_RECORD **"
132echo "Continue? [y]"
133printf "%s" "> "
134read ans
135if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
136 echo "Greenstone was not installed"
137 exit 0
138fi
139script "${gsdlhome}/INSTALL_RECORD"
140
141
142# create initial uninstall.sh
143cd "$gsdlhome"
144echo "#!/bin/sh" > uninstall.sh
145echo "" >> uninstall.sh
146echo "echo \"remove ${gsdlhome} directory? [y]\"" >> uninstall.sh
147echo "read ans" >> uninstall.sh
148echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> uninstall.sh
149echo " $cmd_rmr \"$gsdlhome\"" >> uninstall.sh
150echo "fi" >> uninstall.sh
151$cmd_chmod u+x uninstall.sh
152cd "$thisdir"
153
154echo
155echo "If this installation fails or is cancelled, run the uninstall"
156echo "script (${gsdlhome}/uninstall.sh) to clean up the partial"
157echo "installation."
158echo "Continue? [y]"
159printf "%s" "> "
160read ans
161if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
162 echo "Greenstone was not installed"
163 exit
164 exit 0
165fi
166
167echo
168echo "Installing Greenstone directory structure to ${gsdlhome}"
169# copy gsdl directory across
170echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/gsdl/\"* \"$gsdlhome\"]"
171$cmd_cpr "${cd_dir}/gsdl/"* "$gsdlhome"
172
173# copy setup shell scripts across too
174echo "--> Install.sh: [$cmd_cp \"${cd_dir}/src/Unix/setup.\"* \"$gsdlhome\"]"
175$cmd_cp "${cd_dir}/src/Unix/setup."* "$gsdlhome"
176
177# create the tmp directory
178echo "--> Install.sh: [$cmd_mkdir \"$gsdlhome/tmp\"]"
179$cmd_mkdir "$gsdlhome/tmp"
180
181# make collect directory writable so we can install collections
182echo "--> Install.sh: [$cmd_chmod u+rwx \"$gsdlhome/collect\"]"
183$cmd_chmod u+rwx "$gsdlhome/collect"
184
185# which collections do we want
186cd "${cd_dir}/collect"
187
188echo "The Greenstone demonstration collection has been installed. Would you"
189echo "like to install any other collections from the installation cd-rom? [y]"
190printf "%s" "> "
191read ans
192if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
193
194 echo "Install the greenstone archive (gsarch) - 1Mb? [y]"
195 printf "%s" "> "
196 read ans
197 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
198 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch\" \"${gsdlhome}/collect\"]"
199 $cmd_cpr "${cd_dir}/collect/gsarch" "${gsdlhome}/collect"
200 fi
201
202 echo "Install the MSWord and PDF demonstration collection (wordpdf) - 3Mb? [y]"
203 printf "%s" "> "
204 read ans
205 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
206 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf\" \"${gsdlhome}/collect\"]"
207 $cmd_cpr "${cd_dir}/collect/wordpdf" "${gsdlhome}/collect"
208 fi
209
210 echo "Install the Chinese demonstration collection (chinese) - 1Mb? [y]"
211 printf "%s" "> "
212 read ans
213 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
214 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese\" \"${gsdlhome}/collect\"]"
215 $cmd_cpr "${cd_dir}/collect/chinese" "${gsdlhome}/collect"
216 fi
217
218 echo "Install the food and nutrition library (fnl) - 175 Mb? [y]"
219 printf "%s" "> "
220 read ans
221 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
222 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/fnl\" \"${gsdlhome}/collect\"]"
223 $cmd_cpr "${cd_dir}/collect/fnl" "${gsdlhome}/collect"
224 fi
225
226 echo "Install the language extraction demonstration collection (folktale) - 2Mb? [y]"
227 printf "%s" "> "
228 read ans
229 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
230 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/folktale\" \"${gsdlhome}/collect\"]"
231 $cmd_cpr "${cd_dir}/collect/folktale" "${gsdlhome}/collect"
232 fi
233fi
234
235# set permissions
236echo
237echo "Setting permissions ..."
238echo "--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
239$cmd_chmod -R u+rw "$gsdlhome"
240# gsdl/etc needs to be globally writable
241echo "--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/etc\"]"
242$cmd_chmod -R a+w "$gsdlhome/etc"
243
244# should gsdl/collect and gsdl/tmp be globally writable?
245echo
246echo "In order for end-user collection building to be enabled the"
247echo "Greenstone cgi program must be able to write to the"
248echo "${gsdlhome}/collect and ${gsdlhome}/tmp directories."
249echo "On most systems this means they must be globally writable."
250echo "Make these directories globally writable? [y]"
251printf "%s" "> "
252read ans
253if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
254 echo "--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/collect\"]"
255 $cmd_chmod -R a+w "$gsdlhome/collect"
256 echo "--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/tmp\"]"
257 $cmd_chmod -R a+w "$gsdlhome/tmp"
258fi
259
260# binaries or source code?
261compile="yes"
262if [ "$gsdlos" = "linux" ]; then
263 echo
264 echo "You may either install pre-compiled, statically linked linux [b]inaries"
265 echo "or install and [c]ompile the Greenstone source code"
266
267 found=no
268 while [ "$found" = "no" ]; do
269 echo "Enter \"[b]\" or \"c\""
270 printf "%s" "> "
271 read ans
272 if [ "$ans" = "" ] || [ "$ans" = "b" ]; then
273 compile="no"
274 # install binaries
275 echo
276 echo "Installing linux binaries"
277 echo "--> Install.sh: [$cmd_cpr \"${cd_dir}/Unix/bin/linux\" \"${gsdlhome}/bin\" ]"
278 $cmd_cpr "${cd_dir}/Unix/bin/linux" "${gsdlhome}/bin"
279 echo "--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/linux/\"*]"
280 $cmd_chmod a+x "${gsdlhome}/bin/linux/"*
281 echo "--> Install.sh: [$cmd_chmod -R u+rw \"${gsdlhome}/bin/linux\"]"
282 $cmd_chmod -R u+rw "${gsdlhome}/bin/linux"
283
284 # move library executable to cgi-bin
285 echo "--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/library\" \"${gsdlhome}/cgi-bin\"]"
286 $cmd_mv "${gsdlhome}/bin/linux/library" "${gsdlhome}/cgi-bin"
287
288 found="yes"
289 elif [ "$ans" = "c" ]; then
290 found="yes"
291 fi
292 done
293fi
294
295if [ "$compile" = "yes" ]; then
296 # install source
297 echo
298 echo "Installing source code"
299 echo "--> Install.sh [$cmd_cpr \"${cd_dir}/src/lib\" \"$gsdlhome\"]"
300 $cmd_cpr "${cd_dir}/src/lib" "$gsdlhome"
301 echo "--> Install.sh [$cmd_cpr \"${cd_dir}/src/packages\" \"$gsdlhome\"]"
302 $cmd_cpr "${cd_dir}/src/packages" "$gsdlhome"
303 echo "--> Install.sh [$cmd_cpr \"${cd_dir}/src/src\" \"$gsdlhome\"]"
304 $cmd_cpr "${cd_dir}/src/src" "$gsdlhome"
305 echo "--> Install.sh [$cmd_cpr \"${cd_dir}/src/Unix/\"* \"$gsdlhome\"]"
306 $cmd_cpr "${cd_dir}/src/Unix/"* "$gsdlhome"
307 echo "--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
308 $cmd_chmod -R u+rw "$gsdlhome"
309 echo "--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/configure\"]"
310 $cmd_chmod a+x "${gsdlhome}/configure"
311 echo "--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/packages/yaz/configure\"]"
312 $cmd_chmod a+x "${gsdlhome}/packages/yaz/configure"
313
314 # compile it
315 echo "--> Install.sh: [cd $gsdlhome]"
316 cd "$gsdlhome"
317 echo "configuring ..."
318 echo
319 echo "--> Install.sh: [./configure]"
320 ./configure
321 echo "compiling ..."
322 echo
323 echo "--> Install.sh: [make]"
324 make
325 echo "installing ..."
326 echo
327 echo "--> Install.sh: [make install]"
328 make install
329 echo "--> Install.sh: [cd $thisdir]"
330 cd "$thisdir"
331
332 # check that things compiled ok
333 if [ ! -f "${gsdlhome}/cgi-bin/library" ]; then
334 echo
335 echo "ERROR: Compilation failed"
336 echo "Greenstone was not installed successfully"
337 echo "Run the uninstall script (${gsdlhome}/uninstall.sh)"
338 echo "to clean up the partial installation."
339 exit
340 exit 1
341 fi
342fi
343
344
345# try to find out hostname
346if [ "$gsdlos" = "linux" ]; then
347 hostname=`hostname -f`
348 if [ "$hostname" = "" ]; then
349 hostname=`hostname -i`
350 fi
351fi
352if [ "$hostname" = "" ]; then
353 hostname=`hostname`
354fi
355if [ "$hostname" = "" ]; then
356 hostname="your-computer-name"
357fi
358
359
360# get cgi-bin directory
361echo
362echo
363echo "Greenstone needs a valid cgi executable directory (normally called"
364echo "cgi-bin on unix systems) from which to run."
365echo "This may be either:"
366echo " 1. The default Greenstone cgi-bin directory (${gsdlhome}/cgi-bin)."
367echo " If you use the Greenstone default you will need to configure"
368echo " your webserver to treat this directory as a cgi executable"
369echo " directory. For the Apache webserver you use the ScriptAlias"
370echo " directive to do this (details of how to configure your webserver"
371echo " will be displayed at the end of this installation procedure)."
372if [ "$logname" != "root" ]; then
373echo " Note that you will probably need help from your system"
374echo " administrator to reconfigure your webserver."
375fi
376echo " 2. An existing cgi-bin directory. Normally a cgi-bin directory"
377echo " is created when your webserver is installed. Typically, this"
378echo " might be /home/httpd/cgi-bin, or /usr/local/apache/cgi-bin, or"
379echo " /var/lib/apache/cgi-bin."
380if [ "$logname" != "root" ]; then
381 echo " Many systems also allow individual users to have their own"
382 echo " cgi-bin in /home/username/public_html/cgi-bin."
383fi
384found=no
385remind_cgi="no"
386remind_cgi_nomove="no"
387while [ "$found" = "no" ]; do
388 echo "Enter \"[1]\" or \"2\""
389 printf "%s" "> "
390 read ans
391 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
392 found="option1"
393 cgi_bin="${gsdlhome}/cgi-bin"
394 # default gsdl cgi-bin, do nothing
395 echo
396 echo "Don't forget to configure your webserver to treat $cgi_bin"
397 echo "as a cgi executable directory. Don't worry, you'll be"
398 echo "reminded of this again at the end of the installation"
399 echo "procedure"
400 remind_cgi="yes"
401 elif [ "$ans" = "2" ]; then
402 found="option2"
403 # external cgi-bin
404 echo
405 echo "Enter existing cgi executable directory [/usr/local/apache/cgi-bin]"
406 printf "%s" "> "
407 read ans
408 if [ "$ans" = "" ]; then
409 cgi_bin="/usr/local/apache/cgi-bin"
410 else
411 cgi_bin="$ans"
412 fi
413 if [ ! -d "$cgi_bin" ]; then
414 echo "Warning: The ${cgi_bin} directory does not exist."
415 echo "Create it? [y]"
416 printf "%s" "> "
417 read ans
418 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
419 echo "--> Install.sh: [$cmd_mkdir \"$cgi_bin\"]"
420 $cmd_mkdir "$cgi_bin"
421 if [ -d "$cgi_bin" ]; then
422 echo "Don't forget to configure your webserver to treat $cgi_bin"
423 echo "as a cgi executable directory. Don't worry, you'll be"
424 echo "reminded of this again at the end of the installation"
425 echo "procedure"
426 remind_cgi="yes"
427 else
428 echo "ERROR: failed to create $cgi_bin directory"
429 echo "Greenstone installation failed."
430 echo "Run the uninstall script (${gsdlhome}/uninstall.sh)"
431 echo "to clean up the partial installation."
432 exit
433 exit 1
434 fi
435 fi
436 fi
437
438 if [ ! -w "$cgi_bin" ]; then
439 echo
440 echo "Unable to write to $cgi_bin directory. You will need"
441 echo "to copy the contents of ${gsdlhome}/cgi-bin"
442 echo "to $cgi_bin after this installation is completed."
443 echo "You'll be reminded of this again at the end of the"
444 echo "installation procedure."
445 remind_cgi_nomove="yes"
446 else
447 # install cgi-bin stuff (update the uninstall script first)
448 cd "$gsdlhome"
449 echo "#!/bin/sh" > uninstall.sh
450 echo "" >> uninstall.sh
451 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> uninstall.sh
452 echo "$cmd_rm \"${cgi_bin}/library\"" >> uninstall.sh
453 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> uninstall.sh
454 echo "read ans" >> uninstall.sh
455 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> uninstall.sh
456 echo " $cmd_rmr \"$gsdlhome\"" >> uninstall.sh
457 echo "fi" >> uninstall.sh
458 $cmd_chmod u+x uninstall.sh
459 cd "$thisdir"
460
461 echo
462 echo "Installing Greenstone cgi programs in $cgi_bin"
463 echo "--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/gsdlsite.cfg\" \"$cgi_bin\"]"
464 $cmd_mv "${gsdlhome}/cgi-bin/gsdlsite.cfg" "$cgi_bin"
465 echo "--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/library\" \"$cgi_bin\"]"
466 $cmd_mv "${gsdlhome}/cgi-bin/library" "$cgi_bin"
467 fi
468 fi
469done
470
471# web address of cgi-bin
472web_cgi="http://${hostname}/cgi-bin"
473if [ "$found" = "option1" ]; then
474 web_cgi="http://${hostname}/gsdl/cgi-bin"
475fi
476echo
477echo "Please enter the web address of the $cgi_bin"
478echo "directory. Typically this might be http://localhost/cgi-bin,"
479echo "or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,"
480echo "or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
481printf "%s" "> "
482read ans
483if [ "$ans" != "" ]; then
484 web_cgi="$ans"
485fi
486
487# get public_html directory
488echo
489echo
490echo "In order for Greenstone to run, the $gsdlhome"
491echo "directory and all it contains must be accessible from the web."
492echo "To make this happen you may either:"
493echo " 1. Configure your webserver so that $gsdlhome"
494echo " is itself accessible from the web."
495if [ "$logname" != "root" ]; then
496echo " Note that you will probably need help from your system"
497echo " administrator to reconfigure your webserver."
498fi
499echo " 2. Provide an existing web accessible directory from which"
500echo " a symbolic link will be made to $gsdlhome."
501echo " When your server was installed a web accessible directory"
502echo " will have been created (the Apache webserver uses the"
503echo " DocumentRoot directive to define this directory). Typically"
504echo " this directory might be /home/httpd/html, or /usr/local/apache/htdocs,"
505echo " or /var/lib/apache/htdocs."
506if [ "$logname" != "root" ]; then
507 echo " Many systems also allow individual users to have their own"
508 echo " web accessible directory in /home/username/public_html."
509fi
510echo " Note that your web server will need to be configured to allow"
511echo " symbolic links from within this directory. For the Apache"
512echo " server that means this directory must be configured with"
513echo " the SymLinksIfOwnerMatch or FollowSymLinks option (most Apache"
514echo " installations are configured this way by default)."
515found="no"
516remind_ph="no"
517remind_ph_nolink="no"
518while [ "$found" = "no" ]; do
519 echo "Enter \"[1]\" or \"2\""
520 printf "%s" "> "
521 read ans
522 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
523 found="yes"
524 public_html="$gsdlhome"
525 # no link
526 echo
527 echo "Don't forget to configure your webserver to make $gsdlhome"
528 echo "accessible from the web. You'll be reminded of this again"
529 echo "at the end of this installation procedure."
530 remind_ph="yes"
531 elif [ "$ans" = "2" ]; then
532 found="yes"
533 # external public_html
534 echo
535 public_html="/home/${logname}/public_html"
536 if [ "$logname" = "root" ]; then
537 public_html="/usr/local/apache/htdocs"
538 fi
539 echo "Enter directory that is also accessible from the web [${public_html}]"
540 printf "%s" "> "
541 read ans
542 if [ "$ans" != "" ]; then
543 public_html="$ans"
544 fi
545 # create link to gsdl (and update uninstall.sh)
546 if [ -w "$public_html" ]; then
547 cd "$gsdlhome"
548 echo "#!/bin/sh" > uninstall.sh
549 echo "" >> uninstall.sh
550 echo "$cmd_rm \"$public_html/gsdl\"" >> uninstall.sh
551 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> uninstall.sh
552 echo "$cmd_rm \"${cgi_bin}/library\"" >> uninstall.sh
553 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> uninstall.sh
554 echo "read ans" >> uninstall.sh
555 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> uninstall.sh
556 echo " $cmd_rmr \"$gsdlhome\"" >> uninstall.sh
557 echo "fi" >> uninstall.sh
558 $cmd_chmod u+x uninstall.sh
559 cd "$thisdir"
560
561 echo "--> Install.sh: [cd \"$public_html\"]"
562 cd "$public_html"
563 echo "--> Install.sh: [$cmd_ln \"$gsdlhome\" gsdl]"
564 $cmd_ln "$gsdlhome" gsdl
565 echo "--> Install.sh: [cd \"$thisdir\"]"
566 cd "$thisdir"
567 else
568 echo
569 echo "Unable to write to $public_html directory. You will need"
570 echo "to create a link called gsdl from $public_html to"
571 echo "$gsdlhome after this installation is completed. You'll be"
572 echo "reminded of this again at the end of the installation"
573 echo "procedure."
574 old_ph=$public_html
575 remind_ph_nolink="yes"
576 fi
577 public_html="${public_html}/gsdl"
578 fi
579done
580
581
582# get httpprefix
583echo
584echo "Enter the web address of the $public_html directory."
585echo "This may be a relative url (e.g. \"/gsdl\") or a"
586echo "complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
587printf "%s" ">"
588httpprefix="/gsdl"
589read ans
590if [ "$ans" != "" ]; then
591 httpprefix="$ans"
592fi
593
594# get initial password
595echo
596echo "In order to use end-user collection building or to access certain"
597echo "parts of the administration pages you must have a password."
598echo "A user with the username \"admin\" will be created for you with"
599echo "the password you provide (i.e. to enter any pages requiring user"
600echo "authentication enter the \"admin\" username and the password you"
601echo "set here).\n";
602pw=`${gsdlhome}/bin/${gsdlos}/getpw`
603tmp="[admin]
604<comment>
605<enabled>true
606<groups>administrator,colbuilder
607<password>${pw}
608<username>admin
609----------------------------------------------------------------------"
610echo "Creating user database"
611echo "--> Install.sh: [${gsdlhome}/bin/${gsdlos}/txt2db \"${gsdlhome}/etc/users.db\"]"
612echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
613echo "--> Install.sh: [$cmd_chmod a+rw \"${gsdlhome}/etc/users.db\"]"
614$cmd_chmod a+rw "${gsdlhome}/etc/users.db"
615
616# edit gsdlsite.cfg
617cd "$cgi_bin"
618$cmd_chmod a+rw gsdlsite.cfg
619sed "s|\(gsdlhome *\)[^ ]*|\1${gsdlhome}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
620$cmd_chmod a+rw gsdlsite.cfg
621sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
622$cmd_chmod a+rw gsdlsite.cfg
623sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
624
625echo
626echo
627echo "Greenstone installation completed successfully."
628if [ "$remind_cgi" = "yes" ]; then
629 echo " * Don't forget to configure your webserver to treat"
630 echo " $cgi_bin as a cgi executable directory."
631
632 apache_web_cgi=`echo "$web_cgi" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
633 cgi_bin_slash=`echo "$cgi_bin" | sed "s|/*$|/|"`
634 cgi_bin_noslash=`echo "$cgi_bin" | sed "s|/*$||"`
635
636 echo " For the Apache webserver this means adding the following"
637 echo " ScriptAlias directive to your httpd.conf configuration file."
638 echo
639 echo " ScriptAlias ${apache_web_cgi} \"${cgi_bin_slash}\""
640 echo " <Directory \"${cgi_bin_noslash}\">"
641 echo " AllowOverride None"
642 echo " Options None"
643 echo " Order allow,deny"
644 echo " Allow from all"
645 echo " </Directory>"
646 echo
647fi
648if [ "$remind_cgi_nomove" = "yes" ]; then
649 echo " * Don't forget to move the contents of ${gsdlhome}/cgi-bin"
650 echo " to $cgi_bin"
651 echo
652fi
653if [ "$remind_ph" = "yes" ]; then
654 echo " * Don't forget to configure your webserver to treat"
655 echo " $gsdlhome as a web accessible directory."
656
657 apache_httpprefix=`echo "$httpprefix" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
658 public_html_slash=`echo "$public_html" | sed "s|/*$|/|"`
659 public_html_noslash=`echo "$public_html" | sed "s|/*$||"`
660
661 echo " For the Apache webserver this means adding the following"
662 echo " Alias directive to your httpd.conf configuration file."
663 echo
664 echo " Alias ${apache_httpprefix} \"${public_html_slash}\""
665 echo " <Directory \"${public_html_noslash}\">"
666 echo " Options Indexes MultiViews FollowSymLinks"
667 echo " AllowOverride None"
668 echo " Order allow,deny"
669 echo " Allow from all"
670 echo " </Directory>"
671 echo
672fi
673if [ "$remind_ph_nolink" = "yes" ]; then
674 echo " * Don't forget to create a link called gsdl from $old_ph"
675 echo " to ${gsdlhome}."
676 echo
677fi
678echo "You may remove Greenstone from your system at any time by running"
679echo "the ${gsdlhome}/uninstall.sh script."
680echo "Access Greenstone by pointing a web browser at"
681echo " ${web_cgi}/library"
682echo
683
684exit
685exit 0
Note: See TracBrowser for help on using the repository browser.