3 # Usage: install-bindist.sh [ServerRoot]
4 # This script installs the Apache binary distribution and
5 # was automatically created by binbuild.sh.
10 dirs=`echo $1 | sed -e 's%/% %g'`
18 if test ! -d "${path}" ; then
20 if test $? -ne 0 ; then
21 echo "Failed to create directory: ${path}"
36 test -d ${to} || lmkdir ${to} ${dmode}
37 (cd ${from} && tar -cf - *) | (cd ${to} && tar -xf -)
39 if test "X${fmode}" != X ; then
40 find ${to} -type f -print | xargs chmod ${fmode}
42 if test "X${dmode}" != X ; then
43 find ${to} -type d -print | xargs chmod ${dmode}
48 ## determine path to (optional) Perl interpreter
50 PERL=no-perl5-on-this-system
52 path=`echo $PATH | sed -e 's/:/ /g'`
54 for dir in ${path} ; do
55 for pperl in ${perls} ; do
56 if test -f "${dir}/${pperl}" ; then
57 if `${dir}/${pperl} -v | grep 'version 5\.' >/dev/null 2>&1` ; then
58 PERL="${dir}/${pperl}"
71 echo "Installing binary distribution for platform @os@"
72 echo "into directory $SR ..."
77 lcopy bindist/build $SR/build 750 750
78 lcopy bindist/man $SR/man 755 644
79 if [ -d bindist/modules ]
81 lcopy bindist/modules $SR/modules 750 750
83 lcopy bindist/include $SR/include 755 644
84 lcopy bindist/icons $SR/icons 755 644
85 lcopy bindist/manual $SR/manual 755 644
86 lcopy bindist/cgi-bin $SR/cgi-bin 750 750
87 if [ -f $SR/bin/envvars ]
89 echo "[Preserving existing envvars settings.]"
90 cp -p $SR/bin/envvars ./envvars.orig
95 lcopy bindist/bin $SR/bin 750 750
96 if [ $HAD_ENVVARS = yes ]
98 cp -p ./envvars.orig $SR/bin/envvars
101 lcopy bindist/lib $SR/lib 750 750
104 echo "[Preserving existing configuration files.]"
105 cp bindist/conf/*-std.conf $SR/conf/
107 lcopy bindist/conf $SR/conf 750 640
108 sed -e "s%@default_dir@%$SR%" $SR/conf/httpd-std.conf > $SR/conf/httpd.conf
112 echo "[Preserving existing htdocs directory.]"
114 lcopy bindist/htdocs $SR/htdocs 755 644
118 echo "[Preserving existing error documents directory.]"
120 lcopy bindist/error $SR/error 755 644
123 sed -e "s;^#!\@perlbin\@.*;#!$PERL;" -e "s;\@prefix\@;$SR;" \
124 support/apxs.in > $SR/bin/apxs
125 PRE=`grep "^prefix = " bindist/build/config_vars.mk`
126 PRE=`echo $PRE | sed -e "s;prefix = ;;"`
127 sed -e "s;$PRE;$SR;" bindist/build/config_vars.mk > $SR/build/config_vars.mk
128 sed -e "s;^#!/.*;#!$PERL;" bindist/bin/dbmmanage > $SR/bin/dbmmanage
129 sed -e "s%@default_dir@%$SR%" \
130 -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bindist/bin/apachectl > $SR/bin/apachectl
131 sed -e "s%@default_dir@%$SR%" \
132 bindist/bin/envvars-std > $SR/bin/envvars-std
133 if [ $HAD_ENVVARS = no ]
135 cp -p $SR/bin/envvars-std $SR/bin/envvars
139 echo " +--------------------------------------------------------+"
140 echo " | You now have successfully installed the Apache @ver@ |"
141 echo " | HTTP server. To verify that Apache actually works |"
142 echo " | correctly you should first check the (initially |"
143 echo " | created or preserved) configuration files: |"
145 echo " | $SR/conf/httpd.conf"
147 echo " | You should then be able to immediately fire up |"
148 echo " | Apache the first time by running: |"
150 echo " | $SR/bin/apachectl start "
152 echo " | Thanks for using Apache. The Apache Group |"
153 echo " | http://www.apache.org/ |"
154 echo " +--------------------------------------------------------+"