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 ..."
76 lcopy bindist/man $SR/man 755 644
77 if [ -d bindist/modules ]
79 lcopy bindist/modules $SR/modules 750 750
81 lcopy bindist/include $SR/include 755 644
82 lcopy bindist/icons $SR/icons 755 644
83 lcopy bindist/manual $SR/manual 755 644
84 lcopy bindist/cgi-bin $SR/cgi-bin 750 750
85 lcopy bindist/bin $SR/bin 750 750
88 echo "[Preserving existing configuration files.]"
89 cp bindist/conf/*-std.conf $SR/conf/
91 lcopy bindist/conf $SR/conf 750 640
92 sed -e "s%@default_dir@%$SR%" $SR/conf/httpd-std.conf > $SR/conf/httpd.conf
96 echo "[Preserving existing htdocs directory.]"
98 lcopy bindist/htdocs $SR/htdocs 755 644
102 echo "[Preserving existing error documents directory.]"
104 lcopy bindist/error $SR/error 755 644
107 sed -e "s;^#!/.*;#!$PERL;" -e "s;\@prefix\@;$SR;" -e "s;\@sbindir\@;$SR/bin;" \
108 -e "s;\@libexecdir\@;$SR/libexec;" -e "s;\@includedir\@;$SR/include;" \
109 -e "s;\@sysconfdir\@;$SR/conf;" bindist/bin/apxs > $SR/bin/apxs
110 sed -e "s;^#!/.*;#!$PERL;" bindist/bin/dbmmanage > $SR/bin/dbmmanage
111 sed -e "s%@default_dir@%$SR%" \
112 -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bindist/bin/apachectl > $SR/bin/apachectl
115 echo " +--------------------------------------------------------+"
116 echo " | You now have successfully installed the Apache @ver@ |"
117 echo " | HTTP server. To verify that Apache actually works |"
118 echo " | correctly you should first check the (initially |"
119 echo " | created or preserved) configuration files: |"
121 echo " | $SR/conf/httpd.conf"
123 echo " | You should then be able to immediately fire up |"
124 echo " | Apache the first time by running: |"
126 echo " | $SR/bin/apachectl start "
128 echo " | Thanks for using Apache. The Apache Group |"
129 echo " | http://www.apache.org/ |"
130 echo " +--------------------------------------------------------+"