3 # Copyright 2001-2004 Apache Software Foundation
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
18 # Usage: install-bindist.sh [ServerRoot]
19 # This script installs the Apache binary distribution and
20 # was automatically created by binbuild.sh.
25 dirs=`echo $1 | sed -e 's%/% %g'`
33 if test ! -d "${path}" ; then
35 if test $? -ne 0 ; then
36 echo "Failed to create directory: ${path}"
51 test -d ${to} || lmkdir ${to} ${dmode}
52 (cd ${from} && tar -cf - *) | (cd ${to} && tar -xf -)
54 if test "X${fmode}" != X ; then
55 find ${to} -type f -print | xargs chmod ${fmode}
57 if test "X${dmode}" != X ; then
58 find ${to} -type d -print | xargs chmod ${dmode}
63 ## determine path to (optional) Perl interpreter
65 PERL=no-perl5-on-this-system
67 path=`echo $PATH | sed -e 's/:/ /g'`
70 for dir in ${path} ; do
71 for pperl in ${perls} ; do
72 if test -f "${dir}/${pperl}" ; then
73 if `${dir}/${pperl} -v >/dev/null 2>&1` ; then
74 PERL="${dir}/${pperl}"
80 if test $found_perl = 1 ; then
91 echo "Installing binary distribution for platform @os@"
92 echo "into directory $SR ..."
97 lcopy bindist/build $SR/build 750 750
98 lcopy bindist/man $SR/man 755 644
99 if [ -d bindist/modules ]
101 lcopy bindist/modules $SR/modules 750 750
103 lcopy bindist/include $SR/include 755 644
104 lcopy bindist/icons $SR/icons 755 644
105 lcopy bindist/manual $SR/manual 755 644
106 lcopy bindist/cgi-bin $SR/cgi-bin 750 750
107 if [ -f $SR/bin/envvars ]
109 echo "[Preserving existing envvars settings.]"
110 cp -p $SR/bin/envvars ./envvars.orig
115 lcopy bindist/bin $SR/bin 750 750
116 if [ $HAD_ENVVARS = yes ]
118 cp -p ./envvars.orig $SR/bin/envvars
121 lcopy bindist/lib $SR/lib 750 750
124 echo "[Preserving existing configuration files.]"
125 cp bindist/conf/*-std.conf $SR/conf/
127 lcopy bindist/conf $SR/conf 750 640
128 sed -e "s%@default_dir@%$SR%" $SR/conf/httpd-std.conf > $SR/conf/httpd.conf
132 echo "[Preserving existing htdocs directory.]"
134 lcopy bindist/htdocs $SR/htdocs 755 644
138 echo "[Preserving existing error documents directory.]"
140 lcopy bindist/error $SR/error 755 644
143 sed -e "s;^#!\@perlbin\@.*;#!$PERL;" -e "s;\@exp_installbuilddir\@;$SR/build;" \
144 support/apxs.in > $SR/bin/apxs
145 PRE=`grep "^prefix = " bindist/build/config_vars.mk`
146 PRE=`echo $PRE | sed -e "s;prefix = ;;"`
147 sed -e "s;$PRE;$SR;" bindist/build/config_vars.mk > $SR/build/config_vars.mk
148 sed -e "s;^#!/.*;#!$PERL;" bindist/bin/dbmmanage > $SR/bin/dbmmanage
149 sed -e "s%@default_dir@%$SR%" \
150 -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bindist/bin/apachectl > $SR/bin/apachectl
151 sed -e "s%@default_dir@%$SR%" \
152 bindist/bin/envvars-std > $SR/bin/envvars-std
153 if [ $HAD_ENVVARS = no ]
155 cp -p $SR/bin/envvars-std $SR/bin/envvars
159 echo " +--------------------------------------------------------+"
160 echo " | You now have successfully installed the Apache @ver@ |"
161 echo " | HTTP server. To verify that Apache actually works |"
162 echo " | correctly you should first check the (initially |"
163 echo " | created or preserved) configuration files: |"
165 echo " | $SR/conf/httpd.conf"
167 echo " | You should then be able to immediately fire up |"
168 echo " | Apache the first time by running: |"
170 echo " | $SR/bin/apachectl start "
172 echo " | Thanks for using Apache. The Apache Group |"
173 echo " | http://www.apache.org/ |"
174 echo " +--------------------------------------------------------+"