source: trunk/gsdl/Install.sh@ 3221

Last change on this file since 3221 was 3070, checked in by sjboddie, 22 years ago

renamed hdlsub collection dls

  • Property svn:executable set to *
  • Property svn:mime-type set to application/octet-stream
File size: 36.0 KB
Line 
1#!/bin/sh
2
3## Install.sh -- Install Greenstone
4
5
6# set iscdrom variable to "yes" for a cdrom installation
7iscdrom="yes"
8
9
10cmd_cp="cp"
11cmd_cpr="cp -r"
12cmd_chmod="chmod"
13cmd_mkdir="mkdir -p"
14cmd_ln="ln -s"
15cmd_mv="mv"
16cmd_rm="rm -i"
17cmd_rmr="rm -r"
18
19thisdir=`pwd`
20cd ..
21cd_dir=`pwd`
22cd "$thisdir"
23
24# script must be run from within cdrom/unix directory
25if [ ! -f "${thisdir}/Install.sh" ]; then
26 echo "$itext1"
27 echo "$itext0"
28 exit 1
29fi
30
31# check that various important directories are on the cd
32if [ ! -d "${cd_dir}/gsdl" ]; then
33 echo
34 echo "${itext2}${cd_dir}/gsdl"
35 echo "$itext0"
36 exit 1
37fi
38if [ ! -d "${cd_dir}/Unix/bin/linux" ]; then
39 echo
40 echo "${itext2}${cd_dir}/Unix/bin/linux"
41 echo "$itext0"
42 exit 1
43fi
44
45# install to /usr/local by default if user is "root", otherwise
46# default to users home directory
47gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
48if [ "$gsdlos" = "linux" ]; then
49 logname=`whoami`
50else
51 logname=""
52fi
53if [ "$logname" = "" ]; then
54 logname=`logname`
55fi
56gsdlhome="/home/${logname}"
57if [ "$logname" = "root" ]; then
58 gsdlhome="/usr/local"
59fi
60
61
62itext0="Greenstone was not installed"
63
64itext1="Install.sh must be run from the directory in which it resides"
65
66itext2="ERROR: Could not locate "
67
68itext3="This script will install Greenstone on your system. You may want
69to skim through the Install.pdf document that resides in the docs
70directory on this cd-rom before continuing with the installation."
71
72if [ $iscdrom = "no" ]; then
73 itext3="This script will install Greenstone on your system. You may
74want to download and skim through the Greenstone Installer's Guide
75(Install.pdf) before continuing with the installation"
76fi
77
78itext3="$itext3
79Note that when prompted for input, hitting \"enter\" will select
80the default (given in square brackets [] at the end of each question).
81If you're unsure which option to select, use the default.
82
83Note also that Install.sh prints out information on any commands
84it runs on your system in the form \"--> Install.sh: [command]\".
85
86It is assumed throughout this installation procedure that you
87have a webserver installed on your system.
88
89For later reference the output of this install script will be
90recorded in a file called INSTALL_RECORD in the directory into
91which you choose to install Greenstone.
92
93Continue? [y]"
94
95itext4="
96Which directory should Greenstone be installed to?
97Make sure that this directory is on a partition with sufficient
98free disk space for the installation options you intend selecting."
99
100itext5="
101 * A linux binary installation requires approximately
102 40Mb."
103
104itext6="
105 * Compiling Greenstone from source code requires
106 approximately 155Mb.
107 * Optional Greenstone demonstration collections may use up
108 to a further 200Mb (you'll be told the size of each individual
109 collection before you install it).
110 * Online documentation requires a further 4Mb.
111 * Enabling Greenstone's \"CD exporting\" function requires a
112 further 24Mb.
113Enter directory to install Greenstone into. A gsdl directory
114will be created in this directory. [${gsdlhome}]"
115
116itext34="
117Enter existing cgi executable directory [/usr/local/apache/cgi-bin]"
118
119itext59="
120This installation requires GNU make which could not be detected
121on your system. Please enter the path to gnu make"
122
123echo "$itext3"
124printf "%s" "> "
125read ans
126log="${log}${itext3}
127> $ans
128"
129if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
130 echo "$itext0"
131 exit 0
132fi
133
134# check we've got gnu make (we assume gnu make will always be used on linux)
135make="make"
136if [ "$gsdlos" != "linux" ]; then
137 # if gmake exists, use it
138 whichgmake=`which gmake 2> /dev/null`
139 if [ -x "$whichgmake" ]; then
140 make="gmake"
141 else
142 # try plain old "make"
143 make_ver=`make -v 2> /dev/null | sed -n 's/^GNU.*/GNU/p'`
144 if [ "$make_ver" != "GNU" ]; then
145 echo "$itext59"
146 log="${log}$itext59"
147 printf "%s" "> "
148 read ans
149 make="$ans"
150 fi
151 fi
152fi
153
154# get gsdlhome
155msg="$itext4"
156if [ "$gsdlos" = "linux" ]; then
157msg="${msg}$itext5"
158fi
159msg="${msg}$itext6"
160echo "$msg"
161printf "%s" "> "
162read ans
163log="${log}${msg}
164> $ans
165"
166if [ "$ans" != "" ]; then
167 gsdlhome="$ans"
168fi
169
170itext7="
171Warning: The ${gsdlhome} directory does not exist.
172Create it? [y]"
173
174itext8="ERROR: failed to create $gsdlhome directory"
175
176if [ ! -d "$gsdlhome" ]; then
177 echo "$itext7"
178 printf "%s" "> "
179 read ans
180 log="${log}${itext7}
181> $ans
182"
183 if [ "$ans" = "" ]; then
184 ans="y"
185 fi
186 if [ "$ans" = "y" ]; then
187 msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome\"]"
188 echo "$msg"
189 log="${log}${msg}
190"
191 $cmd_mkdir "$gsdlhome"
192 if [ ! -d "$gsdlhome" ]; then
193 echo "$itext8"
194 echo "$itext0"
195 exit 1
196 fi
197 else
198 echo "$itext0"
199 exit 0
200 fi
201fi
202
203# from now on $gsdlhome includes the "/gsdl"
204gsdlhome="${gsdlhome}/gsdl"
205
206itext9="
207If this installation fails or is cancelled, run the uninstall
208script (${gsdlhome}/Uninstall.sh) to clean up the partial
209installation.
210Continue? [y]"
211
212itext10="
213Installing Greenstone directory structure to ${gsdlhome}"
214
215itext11="
216Would you like to install the Greenstone documentation to your
217hard drive? The docs will use about 4Mb of space. If you choose
218not to install them you can still access them from within the
219docs directory of the cd-rom) [y]"
220
221itext12="
222Would you like to install support for Greenstone's \"CD exporting\"
223function? This function allows you to export a Greenstone collection
224in a form suitable for writing to a self-installing Windows cd-rom.
225This package will use approximately 23Mb of disk space [n]"
226
227itext13="
228The Greenstone demonstration collection has been installed. Would you
229like to install any other collections from the installation cd-rom? [y]
230(note that only the built indexes will be installed for these
231collections - if you require the original source documents you may
232manually copy them from the \"collect\" directory of the cd-rom)"
233
234itext14="
235Install the Greenstone mailing list archive (gsarch) - 3Mb? [y]"
236
237itext15="
238Install the MSWord/PDF/RTF/Postscript demonstration collection (wordpdf) - 4Mb? [y]"
239
240itext16="
241Install the Chinese demonstration collection (chinese) - 6Mb? [y]"
242
243itext17="
244Install the Development Library subset (dls) - 130 Mb? [y]"
245
246itext18="Setting permissions ..."
247
248itext19="
249In order for end-user collection building to be enabled the
250Greenstone cgi program must be able to write to the
251${gsdlhome}/collect and ${gsdlhome}/tmp directories.
252On most systems this means they must be globally writable.
253Make these directories globally writable? [y]"
254
255itext20="
256You may either install pre-compiled, statically linked linux [b]inaries
257(i386 only) or install and [c]ompile the Greenstone source code"
258
259itext21="Enter \"[b]\" or \"c\""
260
261itext22="Installing linux binaries"
262
263itext23="Installing source code"
264
265itext24="configuring ..."
266
267itext25="compiling ..."
268
269itext26="installing ..."
270
271itext27="ERROR: Compilation failed"
272
273itext28="
274
275Greenstone needs a valid cgi executable directory (normally called
276cgi-bin on unix systems) from which to run.
277This may be either:
278 1. The default Greenstone cgi-bin directory (${gsdlhome}/cgi-bin).
279 If you use the Greenstone default you will need to configure
280 your webserver to treat this directory as a cgi executable
281 directory. For the Apache webserver you use the ScriptAlias
282 directive to do this (details of how to configure your webserver
283 will be displayed at the end of this installation procedure)."
284
285itext29=" Note that you will probably need help from your system
286 administrator to reconfigure your webserver."
287
288itext30=" 2. An existing cgi-bin directory. Normally a cgi-bin directory
289 is created when your webserver is installed. Typically, this
290 might be /home/httpd/cgi-bin, or /usr/local/apache/cgi-bin, or
291 /var/lib/apache/cgi-bin."
292
293itext31=" Many systems also allow individual users to have their own
294 cgi-bin in /home/username/public_html/cgi-bin."
295
296itext32="Enter \"[1]\" or \"2\""
297
298itext33="
299Don't forget to configure your webserver to treat ${gsdlhome}/cgi-bin
300as a cgi executable directory. Don't worry, you'll be
301reminded of this again at the end of the installation
302procedure"
303
304itext37="Run the uninstall script (${gsdlhome}/Uninstall.sh)
305to clean up the partial installation."
306
307itext42="
308
309In order for Greenstone to run, the $gsdlhome
310directory and all it contains must be accessible from the web.
311To make this happen you may either:
312 1. Configure your webserver so that $gsdlhome
313 is itself accessible from the web."
314
315itext43=" 2. Provide an existing web accessible directory from which
316 a symbolic link (ln -s) will be made to $gsdlhome.
317 When your server was installed a web accessible directory
318 will have been created (the Apache webserver uses the
319 DocumentRoot directive to define this directory). Typically
320 this directory might be /home/httpd/html, or /usr/local/apache/htdocs,
321 or /var/lib/apache/htdocs."
322
323itext44=" Many systems also allow individual users to have their own
324 web accessible directory in /home/username/public_html."
325
326itext45=" Note that your web server will need to be configured to allow
327 symbolic links from within this directory. For the Apache
328 server that means this directory must be configured with
329 the SymLinksIfOwnerMatch or FollowSymLinks option (most Apache
330 installations are configured this way by default)."
331
332itext46="
333Don't forget to configure your webserver to make $gsdlhome
334accessible from the web. You'll be reminded of this again
335at the end of this installation procedure."
336
337
338msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}\"]"
339echo "$msg"
340log="${log}${msg}
341"
342$cmd_mkdir "$gsdlhome"
343if [ ! -d "$gsdlhome" ]; then
344 echo "$itext8"
345 echo "$itext0"
346 exit 1
347fi
348# set permissions on gsdlhome directory
349msg="--> Install.sh: [$cmd_chmod u+rwx \"${gsdlhome}\"]"
350echo "$msg"
351log="${log}${msg}
352"
353$cmd_chmod u+rwx "$gsdlhome"
354
355# create initial Uninstall.sh
356cd "$gsdlhome"
357echo "#!/bin/sh" > Uninstall.sh
358echo "" >> Uninstall.sh
359echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
360echo "read ans" >> Uninstall.sh
361echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
362echo " $cmd_chmod -R u+rwx \"$gsdlhome\"" >> Uninstall.sh
363echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
364echo "fi" >> Uninstall.sh
365$cmd_chmod u+x Uninstall.sh
366cd "$thisdir"
367
368# create initial INSTALL_RECORD
369echo "$log" >> "${gsdlhome}/INSTALL_RECORD"
370
371echo "$itext9"
372echo "$itext9" >> "${gsdlhome}/INSTALL_RECORD"
373printf "%s" "> "
374read ans
375echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
376if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
377 msg="$itext0"
378 echo "$msg"
379 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
380 exit 0
381fi
382
383echo "$itext10"
384echo "$itext10" >> "${gsdlhome}/INSTALL_RECORD"
385
386# copy gsdl directory across
387msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/gsdl/\"* \"$gsdlhome\"]"
388echo "$msg"
389echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
390$cmd_cpr "${cd_dir}/gsdl/"* "$gsdlhome"
391
392# copy setup shell scripts across too
393msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Unix/setup.\"* \"$gsdlhome\"]"
394echo "$msg"
395echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
396$cmd_cp "${cd_dir}/src/Unix/setup."* "$gsdlhome"
397
398# make sure we have a tmp directory
399if [ ! -d "$gsdlhome/tmp" ]; then
400 msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome/tmp\"]"
401 echo "$msg"
402 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
403 $cmd_mkdir "${gsdlhome}/tmp"
404fi
405
406# make collect directory writable so we can install collections
407msg="--> Install.sh: [$cmd_chmod u+rwx \"$gsdlhome/collect\"]"
408echo "$msg"
409echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
410$cmd_chmod u+rwx "$gsdlhome/collect"
411
412if [ $iscdrom = "yes" ]; then
413 # do we want docs directory?
414 echo "$itext11"
415 echo "$itext11" >> "${gsdlhome}/INSTALL_RECORD"
416 printf "%s" "> "
417 read ans
418 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
419 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
420 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/docs\" \"$gsdlhome\"]"
421 echo "$msg"
422 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
423 $cmd_cpr "${cd_dir}/docs" "$gsdlhome"
424 fi
425
426 # do we want the "CD exporting" stuff?
427 echo "$itext12"
428 echo "$itext12" >> "${gsdlhome}/INSTALL_RECORD"
429 printf "%s" "> "
430 read ans
431 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
432 if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
433 msg="--> Install.sh: [$cmd_chmod u+rw \"${gsdlhome}/bin\"]"
434 echo "$msg"
435 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
436 $cmd_chmod u+rw "${gsdlhome}/bin"
437
438 msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/bin/windows\"]"
439 echo "$msg"
440 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
441 $cmd_mkdir "${gsdlhome}/bin/windows"
442
443 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/netscape\" \"${gsdlhome}/bin/windows\"]"
444 echo "$msg"
445 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
446 $cmd_cpr "${cd_dir}/Windows/bin/windows/netscape" "${gsdlhome}/bin/windows"
447
448 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/Win32s\" \"${gsdlhome}/bin/windows\"]"
449 echo "$msg"
450 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
451 $cmd_cpr "${cd_dir}/Windows/bin/windows/Win32s" "${gsdlhome}/bin/windows"
452
453 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/net16\" \"${gsdlhome}/bin/windows\"]"
454 echo "$msg"
455 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
456 $cmd_cpr "${cd_dir}/Windows/bin/windows/net16" "${gsdlhome}/bin/windows"
457
458 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/net32\" \"${gsdlhome}/bin/windows\"]"
459 echo "$msg"
460 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
461 $cmd_cpr "${cd_dir}/Windows/bin/windows/net32" "${gsdlhome}/bin/windows"
462
463 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/server.exe\" \"${gsdlhome}/bin/windows\"]"
464 echo "$msg"
465 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
466 $cmd_cp "${cd_dir}/Windows/bin/windows/server.exe" "${gsdlhome}/bin/windows"
467
468 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/gssetup.exe\" \"${gsdlhome}/bin/windows\"]"
469 echo "$msg"
470 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
471 $cmd_cp "${cd_dir}/Windows/bin/windows/gssetup.exe" "${gsdlhome}/bin/windows"
472
473 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/setpw.exe\" \"${gsdlhome}/bin/windows\"]"
474 echo "$msg"
475 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
476 $cmd_cp "${cd_dir}/Windows/bin/windows/setpw.exe" "${gsdlhome}/bin/windows"
477
478 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/Setup.exe\" \"${gsdlhome}/bin/windows\"]"
479 echo "$msg"
480 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
481 $cmd_cp "${cd_dir}/Windows/bin/windows/Setup.exe" "${gsdlhome}/bin/windows"
482 fi
483
484
485 # which collections do we want
486 cd "${cd_dir}/collect"
487 echo "$itext13"
488 echo "$itext13" >> "${gsdlhome}/INSTALL_RECORD"
489 printf "%s" "> "
490 read ans
491 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
492 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
493
494 # gsarch
495 echo "$itext14"
496 echo "$itext14" >> "${gsdlhome}/INSTALL_RECORD"
497 printf "%s" "> "
498 read ans
499 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
500 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
501
502 msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/gsarch\"]"
503 echo "$msg"
504 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
505 $cmd_mkdir "${gsdlhome}/collect/gsarch"
506
507 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/etc\" \"${gsdlhome}/collect/gsarch\"]"
508 echo "$msg"
509 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
510 $cmd_cpr "${cd_dir}/collect/gsarch/etc" "${gsdlhome}/collect/gsarch"
511
512 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/images\" \"${gsdlhome}/collect/gsarch\"]"
513 echo "$msg"
514 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
515 $cmd_cpr "${cd_dir}/collect/gsarch/images" "${gsdlhome}/collect/gsarch"
516
517 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/index\" \"${gsdlhome}/collect/gsarch\"]"
518 echo "$msg"
519 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
520 $cmd_cpr "${cd_dir}/collect/gsarch/index" "${gsdlhome}/collect/gsarch"
521 fi
522
523 # wordpdf
524 echo "$itext15"
525 echo "$itext15" >> "${gsdlhome}/INSTALL_RECORD"
526 printf "%s" "> "
527 read ans
528 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
529 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
530
531 msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/wordpdf\"]"
532 echo "$msg"
533 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
534 $cmd_mkdir "${gsdlhome}/collect/wordpdf"
535
536 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/etc\" \"${gsdlhome}/collect/wordpdf\"]"
537 echo "$msg"
538 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
539 $cmd_cpr "${cd_dir}/collect/wordpdf/etc" "${gsdlhome}/collect/wordpdf"
540
541 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/images\" \"${gsdlhome}/collect/wordpdf\"]"
542 echo "$msg"
543 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
544 $cmd_cpr "${cd_dir}/collect/wordpdf/images" "${gsdlhome}/collect/wordpdf"
545
546 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/index\" \"${gsdlhome}/collect/wordpdf\"]"
547 echo "$msg"
548 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
549 $cmd_cpr "${cd_dir}/collect/wordpdf/index" "${gsdlhome}/collect/wordpdf"
550 fi
551
552 # chinese
553 echo "$itext16"
554 echo "$itext16" >> "${gsdlhome}/INSTALL_RECORD"
555 printf "%s" "> "
556 read ans
557 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
558 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
559
560 msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/chinese\"]"
561 echo "$msg"
562 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
563 $cmd_mkdir "${gsdlhome}/collect/chinese"
564
565 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/etc\" \"${gsdlhome}/collect/chinese\"]"
566 echo "$msg"
567 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
568 $cmd_cpr "${cd_dir}/collect/chinese/etc" "${gsdlhome}/collect/chinese"
569
570 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/images\" \"${gsdlhome}/collect/chinese\"]"
571 echo "$msg"
572 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
573 $cmd_cpr "${cd_dir}/collect/chinese/images" "${gsdlhome}/collect/chinese"
574
575 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/index\" \"${gsdlhome}/collect/chinese\"]"
576 echo "$msg"
577 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
578 $cmd_cpr "${cd_dir}/collect/chinese/index" "${gsdlhome}/collect/chinese"
579 fi
580
581 # dls
582 echo "$itext17"
583 echo "$itext17" >> "${gsdlhome}/INSTALL_RECORD"
584 printf "%s" "> "
585 read ans
586 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
587 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
588
589 msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/dls\"]"
590 echo "$msg"
591 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
592 $cmd_mkdir "${gsdlhome}/collect/dls"
593
594 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/dls/etc\" \"${gsdlhome}/collect/dls\"]"
595 echo "$msg"
596 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
597 $cmd_cpr "${cd_dir}/collect/dls/etc" "${gsdlhome}/collect/dls"
598
599 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/dls/images\" \"${gsdlhome}/collect/dls\"]"
600 echo "$msg"
601 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
602 $cmd_cpr "${cd_dir}/collect/dls/images" "${gsdlhome}/collect/dls"
603
604 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/dls/index\" \"${gsdlhome}/collect/dls\"]"
605 echo "$msg"
606 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
607 $cmd_cpr "${cd_dir}/collect/dls/index" "${gsdlhome}/collect/dls"
608 fi
609 fi
610fi
611
612# set permissions
613msg="
614$itext18
615--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]
616--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/script/\"*]"
617echo "$msg"
618echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
619$cmd_chmod -R u+rw "$gsdlhome"
620$cmd_chmod a+x "${gsdlhome}/bin/script/"*
621
622# certain files in gsdl/etc need to be globally writable
623msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/error.txt\"]"
624echo "$msg"
625echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
626$cmd_chmod a+w "$gsdlhome/etc/error.txt"
627msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/key.db\"]"
628echo "$msg"
629echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
630$cmd_chmod a+w "$gsdlhome/etc/key.db"
631msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/users.db\"]"
632echo "$msg"
633echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
634$cmd_chmod a+w "$gsdlhome/etc/users.db"
635msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/main.cfg\"]"
636echo "$msg"
637echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
638$cmd_chmod a+w "$gsdlhome/etc/main.cfg"
639msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/history.db\"]"
640echo "$msg"
641echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
642$cmd_chmod a+w "$gsdlhome/etc/history.db"
643msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/usage.txt\"]"
644echo "$msg"
645echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
646$cmd_chmod a+w "$gsdlhome/etc/usage.txt"
647
648
649# should gsdl/collect and gsdl/tmp be globally writable?
650echo "$itext19"
651echo "$itext19" >> "${gsdlhome}/INSTALL_RECORD"
652printf "%s" "> "
653read ans
654echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
655if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
656 msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/collect\"]"
657 echo "$msg"
658 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
659 $cmd_chmod -R a+w "$gsdlhome/collect"
660 msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/tmp\"]"
661 echo "$msg"
662 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
663 $cmd_chmod -R a+w "$gsdlhome/tmp"
664fi
665
666# binaries or source code?
667compile="yes"
668if [ "$gsdlos" = "linux" ]; then
669 echo "$itext20"
670 echo "$itext20" >> "${gsdlhome}/INSTALL_RECORD"
671
672 found=no
673 while [ "$found" = "no" ]; do
674 echo "$itext21"
675 echo "$itext21" >> "${gsdlhome}/INSTALL_RECORD"
676 printf "%s" "> "
677 read ans
678 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
679 if [ "$ans" = "" ] || [ "$ans" = "b" ]; then
680 compile="no"
681 # install binaries
682 msg="
683$itext22
684--> Install.sh: [$cmd_cpr \"${cd_dir}/Unix/bin/linux\" \"${gsdlhome}/bin\"]"
685 echo "$msg"
686 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
687 $cmd_cpr "${cd_dir}/Unix/bin/linux" "${gsdlhome}/bin"
688 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/linux/\"*]"
689 echo "$msg"
690 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
691 $cmd_chmod a+x "${gsdlhome}/bin/linux/"*
692 msg="--> Install.sh: [$cmd_chmod -R u+rw \"${gsdlhome}/bin/linux\"]"
693 echo "$msg"
694 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
695 $cmd_chmod -R u+rw "${gsdlhome}/bin/linux"
696
697 # move library executable to cgi-bin
698 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/library\" \"${gsdlhome}/cgi-bin\"]"
699 echo "$msg"
700 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
701 $cmd_mv "${gsdlhome}/bin/linux/library" "${gsdlhome}/cgi-bin"
702
703 # move XML.tgz to perllib/cpan and untar it
704 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/XML.tgz\" \"${gsdlhome}/perllib/cpan\"]"
705 echo "$msg"
706 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
707 $cmd_mv "${gsdlhome}/bin/linux/XML.tgz" "${gsdlhome}/perllib/cpan"
708 cd "${gsdlhome}/perllib/cpan"
709 msg="--> Install.sh: [gzip -dc XML.tgz | tar -xf -]"
710 echo "$msg"
711 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
712 gzip -dc XML.tgz | tar -xf -
713
714 found="yes"
715 elif [ "$ans" = "c" ]; then
716 found="yes"
717 fi
718 done
719fi
720
721if [ "$compile" = "yes" ]; then
722 # install source
723 msg="
724$itext23
725--> Install.sh: [$cmd_cpr \"${cd_dir}/src/lib\" \"$gsdlhome\"]"
726 echo "$msg"
727 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
728 $cmd_cpr "${cd_dir}/src/lib" "$gsdlhome"
729 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/packages\" \"$gsdlhome\"]"
730 echo "$msg"
731 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
732 $cmd_cpr "${cd_dir}/src/packages" "$gsdlhome"
733 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/src\" \"$gsdlhome\"]"
734 echo "$msg"
735 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
736 $cmd_cpr "${cd_dir}/src/src" "$gsdlhome"
737 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/Unix/\"* \"$gsdlhome\"]"
738 echo "$msg"
739 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
740 $cmd_cpr "${cd_dir}/src/Unix/"* "$gsdlhome"
741 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Install.txt\" \"$gsdlhome\"]"
742 echo "$msg"
743 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
744 $cmd_cp "${cd_dir}/src/Install.txt" "$gsdlhome"
745 msg="--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
746 echo "$msg"
747 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
748 $cmd_chmod -R u+rw "$gsdlhome"
749 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/configure\"]"
750 echo "$msg"
751 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
752 $cmd_chmod a+x "${gsdlhome}/configure"
753 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/packages/yaz/configure\"]"
754 echo "$msg"
755 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
756 $cmd_chmod a+x "${gsdlhome}/packages/yaz/configure"
757
758 # compile it
759 msg="--> Install.sh: [cd $gsdlhome]"
760 echo "$msg"
761 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
762 cd "$gsdlhome"
763 msg="$itext24
764
765--> Install.sh: [./configure]"
766 echo "$msg"
767 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
768 ./configure
769 msg="$itext25
770
771--> Install.sh: [make]"
772 echo "$msg"
773 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
774 $make
775 msg="$itext26
776
777--> Install.sh: [make install]"
778 echo "$msg"
779 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
780 $make install
781 msg="--> Install.sh: [cd $thisdir]"
782 echo "$msg"
783 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
784 cd "$thisdir"
785
786 # check that things compiled ok
787 if [ ! -f "${gsdlhome}/cgi-bin/library" ]; then
788 msg="$itext27
789$itext0
790$itext37"
791 echo "$msg"
792 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
793 exit 1
794 fi
795fi
796
797
798# try to find out hostname
799if [ "$gsdlos" = "linux" ]; then
800 hostname=`hostname -f`
801 if [ "$hostname" = "" ]; then
802 hostname=`hostname -i`
803 fi
804fi
805if [ "$hostname" = "" ]; then
806 hostname=`hostname`
807fi
808if [ "$hostname" = "" ]; then
809 hostname="your-computer-name"
810fi
811
812
813# get cgi-bin directory
814echo "$itext28"
815echo "$itext28" >> "${gsdlhome}/INSTALL_RECORD"
816if [ "$logname" != "root" ]; then
817 echo "$itext29"
818 echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
819fi
820echo "$itext30"
821echo "$itext30" >> "${gsdlhome}/INSTALL_RECORD"
822if [ "$logname" != "root" ]; then
823 echo "$itext31"
824 echo "$itext31" >> "${gsdlhome}/INSTALL_RECORD"
825fi
826found=no
827remind_cgi="no"
828remind_cgi_nomove="no"
829while [ "$found" = "no" ]; do
830 echo "$itext32"
831 echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
832 printf "%s" "> "
833 read ans
834 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
835 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
836 found="option1"
837 cgi_bin="${gsdlhome}/cgi-bin"
838 # default gsdl cgi-bin, do nothing
839
840 echo "$itext33"
841 echo "$itext33" >> "${gsdlhome}/INSTALL_RECORD"
842 remind_cgi="yes"
843 elif [ "$ans" = "2" ]; then
844 found="option2"
845 # external cgi-bin
846
847 echo "$itext34"
848 echo "$itext34" >> "${gsdlhome}/INSTALL_RECORD"
849 printf "%s" "> "
850 read ans
851 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
852 if [ "$ans" = "" ]; then
853 cgi_bin="/usr/local/apache/cgi-bin"
854 else
855 cgi_bin="$ans"
856 fi
857
858itext35="Warning: The ${cgi_bin} directory does not exist.
859Create it? [y]"
860
861itext36="Don't forget to configure your webserver to treat $cgi_bin
862as a cgi executable directory. Don't worry, you'll be
863reminded of this again at the end of the installation
864procedure"
865
866itext38="ERROR: failed to create $cgi_bin directory"
867
868itext39="
869Unable to write to $cgi_bin directory. You will need
870to copy the contents of ${gsdlhome}/cgi-bin
871to $cgi_bin after this installation is completed.
872You'll be reminded of this again at the end of the
873installation procedure."
874
875itext40="
876Installing Greenstone cgi programs in $cgi_bin"
877
878 if [ ! -d "$cgi_bin" ]; then
879
880 echo "$itext35"
881 echo "$itext35" >> "${gsdlhome}/INSTALL_RECORD"
882 printf "%s" "> "
883 read ans
884 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
885 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
886 msg="--> Install.sh: [$cmd_mkdir \"$cgi_bin\"]"
887 echo "$msg"
888 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
889 $cmd_mkdir "$cgi_bin"
890 if [ -d "$cgi_bin" ]; then
891 echo "$itext36"
892 echo "$itext36" >> "${gsdlhome}/INSTALL_RECORD"
893 remind_cgi="yes"
894 else
895 msg="$itext38
896$itext0
897$itext37"
898 echo "$msg"
899 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
900 exit 1
901 fi
902 fi
903 fi
904
905 if [ ! -w "$cgi_bin" ]; then
906 echo "$itext39"
907 echo "$itext39" >> "${gsdlhome}/INSTALL_RECORD"
908 remind_cgi_nomove="yes"
909 else
910 # install cgi-bin stuff (update the uninstall script first)
911 cd "$gsdlhome"
912 echo "#!/bin/sh" > Uninstall.sh
913 echo "" >> Uninstall.sh
914 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
915 echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
916 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
917 echo "read ans" >> Uninstall.sh
918 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
919 echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
920 echo "fi" >> Uninstall.sh
921 $cmd_chmod u+x Uninstall.sh
922 cd "$thisdir"
923
924 msg="$itext40
925--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/gsdlsite.cfg\" \"$cgi_bin\"]"
926 echo "$msg"
927 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
928 $cmd_mv "${gsdlhome}/cgi-bin/gsdlsite.cfg" "$cgi_bin"
929 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/library\" \"$cgi_bin\"]"
930 echo "$msg"
931 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
932 $cmd_mv "${gsdlhome}/cgi-bin/library" "$cgi_bin"
933 fi
934 fi
935done
936
937# web address of cgi-bin
938web_cgi="http://${hostname}/cgi-bin"
939if [ "$found" = "option1" ]; then
940 web_cgi="http://${hostname}/gsdl/cgi-bin"
941fi
942
943itext41="
944Please enter the web address of the $cgi_bin
945directory. Typically this might be http://localhost/cgi-bin,
946or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,
947or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
948
949echo "$itext41"
950echo "$itext41" >> "${gsdlhome}/INSTALL_RECORD"
951printf "%s" "> "
952read ans
953echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
954if [ "$ans" != "" ]; then
955 web_cgi="$ans"
956fi
957
958# get public_html directory
959echo "$itext42"
960echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
961if [ "$logname" != "root" ]; then
962 echo "$itext29"
963 echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
964fi
965echo "$itext43"
966echo "$itext43" >> "${gsdlhome}/INSTALL_RECORD"
967if [ "$logname" != "root" ]; then
968 echo "$itext44"
969 echo "$itext44" >> "${gsdlhome}/INSTALL_RECORD"
970fi
971echo "$itext45"
972echo "$itext45" >> "${gsdlhome}/INSTALL_RECORD"
973found="no"
974remind_ph="no"
975remind_ph_nolink="no"
976while [ "$found" = "no" ]; do
977 echo "$itext32"
978 echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
979 printf "%s" "> "
980 read ans
981 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
982 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
983 found="yes"
984 public_html="$gsdlhome"
985 # no link
986 echo "$itext46"
987 echo "$itext46" >> "${gsdlhome}/INSTALL_RECORD"
988 remind_ph="yes"
989 elif [ "$ans" = "2" ]; then
990 found="yes"
991 # external public_html
992 echo
993 public_html="/home/${logname}/public_html"
994 if [ "$logname" = "root" ]; then
995 public_html="/usr/local/apache/htdocs"
996 fi
997
998itext47="Enter directory that is also accessible from the web [${public_html}]"
999
1000 echo "$itext47"
1001 echo "$itext47" >> "${gsdlhome}/INSTALL_RECORD"
1002 printf "%s" "> "
1003 read ans
1004 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
1005 if [ "$ans" != "" ]; then
1006 public_html="$ans"
1007 fi
1008
1009itext48="
1010Unable to write to $public_html directory. You will need
1011to create a link called gsdl from $public_html to
1012$gsdlhome after this installation is completed. You'll be
1013reminded of this again at the end of the installation
1014procedure."
1015
1016 # create link to gsdl (and update Uninstall.sh)
1017 if [ -w "$public_html" ]; then
1018 cd "$gsdlhome"
1019 echo "#!/bin/sh" > Uninstall.sh
1020 echo "" >> Uninstall.sh
1021 echo "$cmd_rm \"$public_html/gsdl\"" >> Uninstall.sh
1022 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
1023 echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
1024 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
1025 echo "read ans" >> Uninstall.sh
1026 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
1027 echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
1028 echo "fi" >> Uninstall.sh
1029 $cmd_chmod u+x Uninstall.sh
1030 cd "$thisdir"
1031
1032 msg="--> Install.sh: [cd \"$public_html\"]"
1033 echo "$msg"
1034 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1035 cd "$public_html"
1036 msg="--> Install.sh: [$cmd_ln \"$gsdlhome\" gsdl]"
1037 echo "$msg"
1038 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1039 $cmd_ln "$gsdlhome" gsdl
1040 msg="--> Install.sh: [cd \"$thisdir\"]"
1041 echo "$msg"
1042 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1043 cd "$thisdir"
1044 else
1045 echo "$itext48"
1046 echo "$itext48" >> "${gsdlhome}/INSTALL_RECORD"
1047 old_ph=$public_html
1048 remind_ph_nolink="yes"
1049 fi
1050 public_html="${public_html}/gsdl"
1051 fi
1052done
1053
1054itext49="
1055Enter the web address of the $public_html directory.
1056This may be a relative url (e.g. \"/gsdl\") or a
1057complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
1058
1059itext50="
1060In order to use end-user collection building or to access certain
1061parts of the administration pages you must have a password.
1062A user with the username \"admin\" will be created for you with
1063the password you provide (i.e. to enter any pages requiring user
1064authentication enter the \"admin\" username and the password you
1065set here).
1066"
1067
1068itext51="
1069
1070Greenstone installation completed successfully."
1071
1072itext52=" * Don't forget to configure your webserver to treat
1073 $cgi_bin as a cgi executable directory."
1074
1075itext53=" For the Apache webserver this means adding the following
1076 ScriptAlias directive to your httpd.conf configuration file."
1077
1078itext54=" * Don't forget to move the contents of ${gsdlhome}/cgi-bin
1079 to $cgi_bin
1080"
1081
1082itext55=" * Don't forget to configure your webserver to treat
1083 $gsdlhome as a web accessible directory."
1084
1085itext56=" For the Apache webserver this means adding the following
1086 Alias directive to your httpd.conf configuration file."
1087
1088itext57=" * Don't forget to create a link called gsdl from $old_ph
1089 to ${gsdlhome}.
1090"
1091
1092itext58="The output of this script has been recorded for you at
1093${gsdlhome}/INSTALL_RECORD.
1094You may remove Greenstone from your system at any time by running
1095the ${gsdlhome}/Uninstall.sh script.
1096Access Greenstone by pointing a web browser at
1097${web_cgi}/library
1098"
1099
1100# get httpprefix
1101echo "$itext49"
1102echo "$itext49" >> "${gsdlhome}/INSTALL_RECORD"
1103printf "%s" ">"
1104httpprefix="/gsdl"
1105read ans
1106echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
1107if [ "$ans" != "" ]; then
1108 httpprefix="$ans"
1109fi
1110
1111# get initial password
1112echo "$itext50"
1113echo "$itext50" >> "${gsdlhome}/INSTALL_RECORD"
1114pw=`"${gsdlhome}/bin/${gsdlos}/getpw"`
1115tmp="[admin]
1116<comment>
1117<enabled>true
1118<groups>administrator,colbuilder
1119<password>${pw}
1120<username>admin
1121----------------------------------------------------------------------"
1122echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
1123$cmd_chmod a+rw "${gsdlhome}/etc/users.db"
1124
1125# edit gsdlsite.cfg
1126cd "$cgi_bin"
1127sed "s|\(gsdlhome *\)[^ ]*|\1\"${gsdlhome}\"|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1128sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1129sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1130
1131# success
1132echo "$itext51"
1133echo "$itext51" >> "${gsdlhome}/INSTALL_RECORD"
1134if [ "$remind_cgi" = "yes" ]; then
1135 echo "$itext52"
1136 echo "$itext52" >> "${gsdlhome}/INSTALL_RECORD"
1137
1138 apache_web_cgi=`echo "$web_cgi" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
1139 cgi_bin_slash=`echo "$cgi_bin" | sed "s|/*$|/|"`
1140 cgi_bin_noslash=`echo "$cgi_bin" | sed "s|/*$||"`
1141
1142 msg="$itext53
1143
1144 ScriptAlias ${apache_web_cgi} \"${cgi_bin_slash}\"
1145 <Directory \"${cgi_bin_noslash}\">
1146 AllowOverride None
1147 Options None
1148 Order allow,deny
1149 Allow from all
1150 </Directory>
1151"
1152 echo "$msg"
1153 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1154fi
1155if [ "$remind_cgi_nomove" = "yes" ]; then
1156 echo "$itext54"
1157 echo "$itext54" >> "${gsdlhome}/INSTALL_RECORD"
1158fi
1159if [ "$remind_ph" = "yes" ]; then
1160 echo "$itext55"
1161 echo "$itext55" >> "${gsdlhome}/INSTALL_RECORD"
1162
1163 apache_httpprefix=`echo "$httpprefix" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
1164 public_html_slash=`echo "$public_html" | sed "s|/*$|/|"`
1165 public_html_noslash=`echo "$public_html" | sed "s|/*$||"`
1166
1167 msg="$itext56
1168
1169 Alias ${apache_httpprefix} \"${public_html_slash}\"
1170 <Directory \"${public_html_noslash}\">
1171 Options Indexes MultiViews FollowSymLinks
1172 AllowOverride None
1173 Order allow,deny
1174 Allow from all
1175 </Directory>
1176"
1177 echo "$msg"
1178 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1179fi
1180if [ "$remind_ph_nolink" = "yes" ]; then
1181 echo "$itext57"
1182 echo "$itext57" >> "${gsdlhome}/INSTALL_RECORD"
1183fi
1184echo "$itext58"
1185echo "$itext58" >> "${gsdlhome}/INSTALL_RECORD"
1186
1187exit 0
Note: See TracBrowser for help on using the repository browser.