source: trunk/gsdl/Install.sh@ 2247

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

Unix install script now uses full names of collections and includes
the size of each collection to install.

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