source: trunk/gsdl/Install.sh@ 2914

Last change on this file since 2914 was 2914, checked in by sjboddie, 21 years ago

Minor configuration changes to solve problems installing on solaris

  • Property svn:executable set to *
  • Property svn:mime-type set to application/octet-stream
File size: 36.2 KB
Line 
1#!/bin/sh
2
3## Install.sh -- Install Greenstone
4
5
6# set iscdrom variable to "yes" for a cdrom installation
7iscdrom="no"
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 | tr A-Z a-z`
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 Humanity Development Library subset (hdlsub) - 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 # hdlsub
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/hdlsub\"]"
590 echo "$msg"
591 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
592 $cmd_mkdir "${gsdlhome}/collect/hdlsub"
593
594 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/etc\" \"${gsdlhome}/collect/hdlsub\"]"
595 echo "$msg"
596 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
597 $cmd_cpr "${cd_dir}/collect/hdlsub/etc" "${gsdlhome}/collect/hdlsub"
598
599 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/images\" \"${gsdlhome}/collect/hdlsub\"]"
600 echo "$msg"
601 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
602 $cmd_cpr "${cd_dir}/collect/hdlsub/images" "${gsdlhome}/collect/hdlsub"
603
604 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/index\" \"${gsdlhome}/collect/hdlsub\"]"
605 echo "$msg"
606 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
607 $cmd_cpr "${cd_dir}/collect/hdlsub/index" "${gsdlhome}/collect/hdlsub"
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/errout.txt\"]"
624echo "$msg"
625echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
626$cmd_chmod a+w "$gsdlhome/etc/errout.txt"
627msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/initout.txt\"]"
628echo "$msg"
629echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
630$cmd_chmod a+w "$gsdlhome/etc/initout.txt"
631msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/key.db\"]"
632echo "$msg"
633echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
634$cmd_chmod a+w "$gsdlhome/etc/key.db"
635msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/users.db\"]"
636echo "$msg"
637echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
638$cmd_chmod a+w "$gsdlhome/etc/users.db"
639msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/main.cfg\"]"
640echo "$msg"
641echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
642$cmd_chmod a+w "$gsdlhome/etc/main.cfg"
643msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/history.db\"]"
644echo "$msg"
645echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
646$cmd_chmod a+w "$gsdlhome/etc/history.db"
647msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/usage.txt\"]"
648echo "$msg"
649echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
650$cmd_chmod a+w "$gsdlhome/etc/usage.txt"
651
652
653# should gsdl/collect and gsdl/tmp be globally writable?
654echo "$itext19"
655echo "$itext19" >> "${gsdlhome}/INSTALL_RECORD"
656printf "%s" "> "
657read ans
658echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
659if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
660 msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/collect\"]"
661 echo "$msg"
662 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
663 $cmd_chmod -R a+w "$gsdlhome/collect"
664 msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/tmp\"]"
665 echo "$msg"
666 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
667 $cmd_chmod -R a+w "$gsdlhome/tmp"
668fi
669
670# binaries or source code?
671compile="yes"
672if [ "$gsdlos" = "linux" ]; then
673 echo "$itext20"
674 echo "$itext20" >> "${gsdlhome}/INSTALL_RECORD"
675
676 found=no
677 while [ "$found" = "no" ]; do
678 echo "$itext21"
679 echo "$itext21" >> "${gsdlhome}/INSTALL_RECORD"
680 printf "%s" "> "
681 read ans
682 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
683 if [ "$ans" = "" ] || [ "$ans" = "b" ]; then
684 compile="no"
685 # install binaries
686 msg="
687$itext22
688--> Install.sh: [$cmd_cpr \"${cd_dir}/Unix/bin/linux\" \"${gsdlhome}/bin\"]"
689 echo "$msg"
690 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
691 $cmd_cpr "${cd_dir}/Unix/bin/linux" "${gsdlhome}/bin"
692 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/linux/\"*]"
693 echo "$msg"
694 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
695 $cmd_chmod a+x "${gsdlhome}/bin/linux/"*
696 msg="--> Install.sh: [$cmd_chmod -R u+rw \"${gsdlhome}/bin/linux\"]"
697 echo "$msg"
698 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
699 $cmd_chmod -R u+rw "${gsdlhome}/bin/linux"
700
701 # move library executable to cgi-bin
702 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/library\" \"${gsdlhome}/cgi-bin\"]"
703 echo "$msg"
704 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
705 $cmd_mv "${gsdlhome}/bin/linux/library" "${gsdlhome}/cgi-bin"
706
707 # move XML.tgz to perllib/cpan and untar it
708 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/XML.tgz\" \"${gsdlhome}/perllib/cpan\"]"
709 echo "$msg"
710 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
711 $cmd_mv "${gsdlhome}/bin/linux/XML.tgz" "${gsdlhome}/perllib/cpan"
712 cd "${gsdlhome}/perllib/cpan"
713 msg="--> Install.sh: [gzip -dc XML.tgz | tar -xf -]"
714 echo "$msg"
715 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
716 gzip -dc XML.tgz | tar -xf -
717
718 found="yes"
719 elif [ "$ans" = "c" ]; then
720 found="yes"
721 fi
722 done
723fi
724
725if [ "$compile" = "yes" ]; then
726 # install source
727 msg="
728$itext23
729--> Install.sh: [$cmd_cpr \"${cd_dir}/src/lib\" \"$gsdlhome\"]"
730 echo "$msg"
731 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
732 $cmd_cpr "${cd_dir}/src/lib" "$gsdlhome"
733 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/packages\" \"$gsdlhome\"]"
734 echo "$msg"
735 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
736 $cmd_cpr "${cd_dir}/src/packages" "$gsdlhome"
737 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/src\" \"$gsdlhome\"]"
738 echo "$msg"
739 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
740 $cmd_cpr "${cd_dir}/src/src" "$gsdlhome"
741 msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/Unix/\"* \"$gsdlhome\"]"
742 echo "$msg"
743 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
744 $cmd_cpr "${cd_dir}/src/Unix/"* "$gsdlhome"
745 msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Install.txt\" \"$gsdlhome\"]"
746 echo "$msg"
747 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
748 $cmd_cp "${cd_dir}/src/Install.txt" "$gsdlhome"
749 msg="--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
750 echo "$msg"
751 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
752 $cmd_chmod -R u+rw "$gsdlhome"
753 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/configure\"]"
754 echo "$msg"
755 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
756 $cmd_chmod a+x "${gsdlhome}/configure"
757 msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/packages/yaz/configure\"]"
758 echo "$msg"
759 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
760 $cmd_chmod a+x "${gsdlhome}/packages/yaz/configure"
761
762 # compile it
763 msg="--> Install.sh: [cd $gsdlhome]"
764 echo "$msg"
765 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
766 cd "$gsdlhome"
767 msg="$itext24
768
769--> Install.sh: [./configure]"
770 echo "$msg"
771 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
772 ./configure
773 msg="$itext25
774
775--> Install.sh: [make]"
776 echo "$msg"
777 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
778 $make
779 msg="$itext26
780
781--> Install.sh: [make install]"
782 echo "$msg"
783 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
784 $make install
785 msg="--> Install.sh: [cd $thisdir]"
786 echo "$msg"
787 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
788 cd "$thisdir"
789
790 # check that things compiled ok
791 if [ ! -f "${gsdlhome}/cgi-bin/library" ]; then
792 msg="$itext27
793$itext0
794$itext37"
795 echo "$msg"
796 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
797 exit 1
798 fi
799fi
800
801
802# try to find out hostname
803if [ "$gsdlos" = "linux" ]; then
804 hostname=`hostname -f`
805 if [ "$hostname" = "" ]; then
806 hostname=`hostname -i`
807 fi
808fi
809if [ "$hostname" = "" ]; then
810 hostname=`hostname`
811fi
812if [ "$hostname" = "" ]; then
813 hostname="your-computer-name"
814fi
815
816
817# get cgi-bin directory
818echo "$itext28"
819echo "$itext28" >> "${gsdlhome}/INSTALL_RECORD"
820if [ "$logname" != "root" ]; then
821 echo "$itext29"
822 echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
823fi
824echo "$itext30"
825echo "$itext30" >> "${gsdlhome}/INSTALL_RECORD"
826if [ "$logname" != "root" ]; then
827 echo "$itext31"
828 echo "$itext31" >> "${gsdlhome}/INSTALL_RECORD"
829fi
830found=no
831remind_cgi="no"
832remind_cgi_nomove="no"
833while [ "$found" = "no" ]; do
834 echo "$itext32"
835 echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
836 printf "%s" "> "
837 read ans
838 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
839 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
840 found="option1"
841 cgi_bin="${gsdlhome}/cgi-bin"
842 # default gsdl cgi-bin, do nothing
843
844 echo "$itext33"
845 echo "$itext33" >> "${gsdlhome}/INSTALL_RECORD"
846 remind_cgi="yes"
847 elif [ "$ans" = "2" ]; then
848 found="option2"
849 # external cgi-bin
850
851 echo "$itext34"
852 echo "$itext34" >> "${gsdlhome}/INSTALL_RECORD"
853 printf "%s" "> "
854 read ans
855 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
856 if [ "$ans" = "" ]; then
857 cgi_bin="/usr/local/apache/cgi-bin"
858 else
859 cgi_bin="$ans"
860 fi
861
862itext35="Warning: The ${cgi_bin} directory does not exist.
863Create it? [y]"
864
865itext36="Don't forget to configure your webserver to treat $cgi_bin
866as a cgi executable directory. Don't worry, you'll be
867reminded of this again at the end of the installation
868procedure"
869
870itext38="ERROR: failed to create $cgi_bin directory"
871
872itext39="
873Unable to write to $cgi_bin directory. You will need
874to copy the contents of ${gsdlhome}/cgi-bin
875to $cgi_bin after this installation is completed.
876You'll be reminded of this again at the end of the
877installation procedure."
878
879itext40="
880Installing Greenstone cgi programs in $cgi_bin"
881
882 if [ ! -d "$cgi_bin" ]; then
883
884 echo "$itext35"
885 echo "$itext35" >> "${gsdlhome}/INSTALL_RECORD"
886 printf "%s" "> "
887 read ans
888 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
889 if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
890 msg="--> Install.sh: [$cmd_mkdir \"$cgi_bin\"]"
891 echo "$msg"
892 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
893 $cmd_mkdir "$cgi_bin"
894 if [ -d "$cgi_bin" ]; then
895 echo "$itext36"
896 echo "$itext36" >> "${gsdlhome}/INSTALL_RECORD"
897 remind_cgi="yes"
898 else
899 msg="$itext38
900$itext0
901$itext37"
902 echo "$msg"
903 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
904 exit 1
905 fi
906 fi
907 fi
908
909 if [ ! -w "$cgi_bin" ]; then
910 echo "$itext39"
911 echo "$itext39" >> "${gsdlhome}/INSTALL_RECORD"
912 remind_cgi_nomove="yes"
913 else
914 # install cgi-bin stuff (update the uninstall script first)
915 cd "$gsdlhome"
916 echo "#!/bin/sh" > Uninstall.sh
917 echo "" >> Uninstall.sh
918 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
919 echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
920 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
921 echo "read ans" >> Uninstall.sh
922 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
923 echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
924 echo "fi" >> Uninstall.sh
925 $cmd_chmod u+x Uninstall.sh
926 cd "$thisdir"
927
928 msg="$itext40
929--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/gsdlsite.cfg\" \"$cgi_bin\"]"
930 echo "$msg"
931 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
932 $cmd_mv "${gsdlhome}/cgi-bin/gsdlsite.cfg" "$cgi_bin"
933 msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/library\" \"$cgi_bin\"]"
934 echo "$msg"
935 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
936 $cmd_mv "${gsdlhome}/cgi-bin/library" "$cgi_bin"
937 fi
938 fi
939done
940
941# web address of cgi-bin
942web_cgi="http://${hostname}/cgi-bin"
943if [ "$found" = "option1" ]; then
944 web_cgi="http://${hostname}/gsdl/cgi-bin"
945fi
946
947itext41="
948Please enter the web address of the $cgi_bin
949directory. Typically this might be http://localhost/cgi-bin,
950or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,
951or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
952
953echo "$itext41"
954echo "$itext41" >> "${gsdlhome}/INSTALL_RECORD"
955printf "%s" "> "
956read ans
957echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
958if [ "$ans" != "" ]; then
959 web_cgi="$ans"
960fi
961
962# get public_html directory
963echo "$itext42"
964echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
965if [ "$logname" != "root" ]; then
966 echo "$itext29"
967 echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
968fi
969echo "$itext43"
970echo "$itext43" >> "${gsdlhome}/INSTALL_RECORD"
971if [ "$logname" != "root" ]; then
972 echo "$itext44"
973 echo "$itext44" >> "${gsdlhome}/INSTALL_RECORD"
974fi
975echo "$itext45"
976echo "$itext45" >> "${gsdlhome}/INSTALL_RECORD"
977found="no"
978remind_ph="no"
979remind_ph_nolink="no"
980while [ "$found" = "no" ]; do
981 echo "$itext32"
982 echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
983 printf "%s" "> "
984 read ans
985 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
986 if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
987 found="yes"
988 public_html="$gsdlhome"
989 # no link
990 echo "$itext46"
991 echo "$itext46" >> "${gsdlhome}/INSTALL_RECORD"
992 remind_ph="yes"
993 elif [ "$ans" = "2" ]; then
994 found="yes"
995 # external public_html
996 echo
997 public_html="/home/${logname}/public_html"
998 if [ "$logname" = "root" ]; then
999 public_html="/usr/local/apache/htdocs"
1000 fi
1001
1002itext47="Enter directory that is also accessible from the web [${public_html}]"
1003
1004 echo "$itext47"
1005 echo "$itext47" >> "${gsdlhome}/INSTALL_RECORD"
1006 printf "%s" "> "
1007 read ans
1008 echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
1009 if [ "$ans" != "" ]; then
1010 public_html="$ans"
1011 fi
1012
1013itext48="
1014Unable to write to $public_html directory. You will need
1015to create a link called gsdl from $public_html to
1016$gsdlhome after this installation is completed. You'll be
1017reminded of this again at the end of the installation
1018procedure."
1019
1020 # create link to gsdl (and update Uninstall.sh)
1021 if [ -w "$public_html" ]; then
1022 cd "$gsdlhome"
1023 echo "#!/bin/sh" > Uninstall.sh
1024 echo "" >> Uninstall.sh
1025 echo "$cmd_rm \"$public_html/gsdl\"" >> Uninstall.sh
1026 echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
1027 echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
1028 echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
1029 echo "read ans" >> Uninstall.sh
1030 echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
1031 echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
1032 echo "fi" >> Uninstall.sh
1033 $cmd_chmod u+x Uninstall.sh
1034 cd "$thisdir"
1035
1036 msg="--> Install.sh: [cd \"$public_html\"]"
1037 echo "$msg"
1038 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1039 cd "$public_html"
1040 msg="--> Install.sh: [$cmd_ln \"$gsdlhome\" gsdl]"
1041 echo "$msg"
1042 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1043 $cmd_ln "$gsdlhome" gsdl
1044 msg="--> Install.sh: [cd \"$thisdir\"]"
1045 echo "$msg"
1046 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1047 cd "$thisdir"
1048 else
1049 echo "$itext48"
1050 echo "$itext48" >> "${gsdlhome}/INSTALL_RECORD"
1051 old_ph=$public_html
1052 remind_ph_nolink="yes"
1053 fi
1054 public_html="${public_html}/gsdl"
1055 fi
1056done
1057
1058itext49="
1059Enter the web address of the $public_html directory.
1060This may be a relative url (e.g. \"/gsdl\") or a
1061complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
1062
1063itext50="
1064In order to use end-user collection building or to access certain
1065parts of the administration pages you must have a password.
1066A user with the username \"admin\" will be created for you with
1067the password you provide (i.e. to enter any pages requiring user
1068authentication enter the \"admin\" username and the password you
1069set here).
1070"
1071
1072itext51="
1073
1074Greenstone installation completed successfully."
1075
1076itext52=" * Don't forget to configure your webserver to treat
1077 $cgi_bin as a cgi executable directory."
1078
1079itext53=" For the Apache webserver this means adding the following
1080 ScriptAlias directive to your httpd.conf configuration file."
1081
1082itext54=" * Don't forget to move the contents of ${gsdlhome}/cgi-bin
1083 to $cgi_bin
1084"
1085
1086itext55=" * Don't forget to configure your webserver to treat
1087 $gsdlhome as a web accessible directory."
1088
1089itext56=" For the Apache webserver this means adding the following
1090 Alias directive to your httpd.conf configuration file."
1091
1092itext57=" * Don't forget to create a link called gsdl from $old_ph
1093 to ${gsdlhome}.
1094"
1095
1096itext58="The output of this script has been recorded for you at
1097${gsdlhome}/INSTALL_RECORD.
1098You may remove Greenstone from your system at any time by running
1099the ${gsdlhome}/Uninstall.sh script.
1100Access Greenstone by pointing a web browser at
1101${web_cgi}/library
1102"
1103
1104# get httpprefix
1105echo "$itext49"
1106echo "$itext49" >> "${gsdlhome}/INSTALL_RECORD"
1107printf "%s" ">"
1108httpprefix="/gsdl"
1109read ans
1110echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
1111if [ "$ans" != "" ]; then
1112 httpprefix="$ans"
1113fi
1114
1115# get initial password
1116echo "$itext50"
1117echo "$itext50" >> "${gsdlhome}/INSTALL_RECORD"
1118pw=`"${gsdlhome}/bin/${gsdlos}/getpw"`
1119tmp="[admin]
1120<comment>
1121<enabled>true
1122<groups>administrator,colbuilder
1123<password>${pw}
1124<username>admin
1125----------------------------------------------------------------------"
1126echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
1127$cmd_chmod a+rw "${gsdlhome}/etc/users.db"
1128
1129# edit gsdlsite.cfg
1130cd "$cgi_bin"
1131sed "s|\(gsdlhome *\)[^ ]*|\1\"${gsdlhome}\"|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1132sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1133sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
1134
1135# success
1136echo "$itext51"
1137echo "$itext51" >> "${gsdlhome}/INSTALL_RECORD"
1138if [ "$remind_cgi" = "yes" ]; then
1139 echo "$itext52"
1140 echo "$itext52" >> "${gsdlhome}/INSTALL_RECORD"
1141
1142 apache_web_cgi=`echo "$web_cgi" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
1143 cgi_bin_slash=`echo "$cgi_bin" | sed "s|/*$|/|"`
1144 cgi_bin_noslash=`echo "$cgi_bin" | sed "s|/*$||"`
1145
1146 msg="$itext53
1147
1148 ScriptAlias ${apache_web_cgi} \"${cgi_bin_slash}\"
1149 <Directory \"${cgi_bin_noslash}\">
1150 AllowOverride None
1151 Options None
1152 Order allow,deny
1153 Allow from all
1154 </Directory>
1155"
1156 echo "$msg"
1157 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1158fi
1159if [ "$remind_cgi_nomove" = "yes" ]; then
1160 echo "$itext54"
1161 echo "$itext54" >> "${gsdlhome}/INSTALL_RECORD"
1162fi
1163if [ "$remind_ph" = "yes" ]; then
1164 echo "$itext55"
1165 echo "$itext55" >> "${gsdlhome}/INSTALL_RECORD"
1166
1167 apache_httpprefix=`echo "$httpprefix" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
1168 public_html_slash=`echo "$public_html" | sed "s|/*$|/|"`
1169 public_html_noslash=`echo "$public_html" | sed "s|/*$||"`
1170
1171 msg="$itext56
1172
1173 Alias ${apache_httpprefix} \"${public_html_slash}\"
1174 <Directory \"${public_html_noslash}\">
1175 Options Indexes MultiViews FollowSymLinks
1176 AllowOverride None
1177 Order allow,deny
1178 Allow from all
1179 </Directory>
1180"
1181 echo "$msg"
1182 echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
1183fi
1184if [ "$remind_ph_nolink" = "yes" ]; then
1185 echo "$itext57"
1186 echo "$itext57" >> "${gsdlhome}/INSTALL_RECORD"
1187fi
1188echo "$itext58"
1189echo "$itext58" >> "${gsdlhome}/INSTALL_RECORD"
1190
1191exit 0
Note: See TracBrowser for help on using the repository browser.