source: main/tags/2.26/gsdl/Install.sh@ 28875

Last change on this file since 28875 was 1594, checked in by sjboddie, 24 years ago

Minor bug fixes to unix install script

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