source: trunk/gsdl/Install.sh@ 1493

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

added getpw and ability to set initial password from within installation
script

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