3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
19 # Usage: install-bindist.sh [ServerRoot]
20 # This script installs the Apache binary distribution and
21 # was automatically created by binbuild.sh.
26 dirs=`echo $1 | sed -e 's%/% %g'`
34 if test ! -d "${path}" ; then
36 if test $? -ne 0 ; then
37 echo "Failed to create directory: ${path}"
52 test -d ${to} || lmkdir ${to} ${dmode}
53 (cd ${from} && tar -cf - *) | (cd ${to} && tar -xf -)
55 if test "X${fmode}" != X ; then
56 find ${to} -type f -print | xargs chmod ${fmode}
58 if test "X${dmode}" != X ; then
59 find ${to} -type d -print | xargs chmod ${dmode}
64 ## determine path to (optional) Perl interpreter
66 PERL=no-perl5-on-this-system
68 path=`echo $PATH | sed -e 's/:/ /g'`
71 for dir in ${path} ; do
72 for pperl in ${perls} ; do
73 if test -f "${dir}/${pperl}" ; then
74 if `${dir}/${pperl} -v >/dev/null 2>&1` ; then
75 PERL="${dir}/${pperl}"
81 if test $found_perl = 1 ; then
92 echo "Installing binary distribution for platform @os@"
93 echo "into directory $SR ..."
98 lcopy bindist/build $SR/build 750 750
99 lcopy bindist/man $SR/man 755 644
100 if [ -d bindist/modules ]
102 lcopy bindist/modules $SR/modules 750 750
104 lcopy bindist/include $SR/include 755 644
105 lcopy bindist/icons $SR/icons 755 644
106 lcopy bindist/manual $SR/manual 755 644
107 lcopy bindist/cgi-bin $SR/cgi-bin 750 750
108 if [ -f $SR/bin/envvars ]
110 echo "[Preserving existing envvars settings.]"
111 cp -p $SR/bin/envvars ./envvars.orig
116 lcopy bindist/bin $SR/bin 750 750
117 if [ $HAD_ENVVARS = yes ]
119 cp -p ./envvars.orig $SR/bin/envvars
122 lcopy bindist/lib $SR/lib 750 750
125 echo "[Preserving existing configuration files.]"
126 cp bindist/conf/*-std.conf $SR/conf/
128 lcopy bindist/conf $SR/conf 750 640
129 sed -e "s%@default_dir@%$SR%" $SR/conf/httpd-std.conf > $SR/conf/httpd.conf
133 echo "[Preserving existing htdocs directory.]"
135 lcopy bindist/htdocs $SR/htdocs 755 644
139 echo "[Preserving existing error documents directory.]"
141 lcopy bindist/error $SR/error 755 644
144 sed -e "s;^#!\@perlbin\@.*;#!$PERL;" -e "s;\@exp_installbuilddir\@;$SR/build;" \
145 support/apxs.in > $SR/bin/apxs
146 PRE=`grep "^prefix = " bindist/build/config_vars.mk`
147 PRE=`echo $PRE | sed -e "s;prefix = ;;"`
148 sed -e "s;$PRE;$SR;" bindist/build/config_vars.mk > $SR/build/config_vars.mk
149 sed -e "s;^#!/.*;#!$PERL;" bindist/bin/dbmmanage > $SR/bin/dbmmanage
150 sed -e "s%@default_dir@%$SR%" \
151 -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bindist/bin/apachectl > $SR/bin/apachectl
152 sed -e "s%@default_dir@%$SR%" \
153 bindist/bin/envvars-std > $SR/bin/envvars-std
154 if [ $HAD_ENVVARS = no ]
156 cp -p $SR/bin/envvars-std $SR/bin/envvars
160 echo " +--------------------------------------------------------+"
161 echo " | You now have successfully installed the Apache @ver@ |"
162 echo " | HTTP server. To verify that Apache actually works |"
163 echo " | correctly you should first check the (initially |"
164 echo " | created or preserved) configuration files: |"
166 echo " | $SR/conf/httpd.conf"
168 echo " | You should then be able to immediately fire up |"
169 echo " | Apache the first time by running: |"
171 echo " | $SR/bin/apachectl start "
173 echo " | Thanks for using Apache. The Apache Group |"
174 echo " | http://www.apache.org/ |"
175 echo " +--------------------------------------------------------+"