root/gsdl/trunk/runtime-src/packages/apache-httpd/install-bindist.sh @ 18814

Revision 18814, 3.6 KB (checked in by ak19, 11 years ago)

Making the apache webserver relocatable for the release-kit. 1. Modified httpd.conf.in (GSDLHOME/apache-httpd/GSDLOS placeholder now APACHE_HOME_OS); 2. Modified the install-bindist.sh script for installing the relocatable apache webserver so that it is customised and doesn't do more than we need; 3. Added in apxs.in from the webserver's Support folder (inside httpd-2.2.11 folder). Do we get it from there dynamically or keep a static copy here?

  • Property svn:executable set to *
Line 
1#!/bin/sh
2#
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
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
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.
17#
18#
19# Usage: install-bindist.sh [ServerRoot]
20# This script installs the Apache binary distribution and
21# was automatically created by binbuild.sh.
22
23
24##
25##  determine path to (optional) Perl interpreter
26##
27PERL=no-perl5-on-this-system
28perls='perl5 perl'
29path=`echo $PATH | sed -e 's/:/ /g'`
30found_perl=0
31 
32for dir in ${path} ;  do
33  for pperl in ${perls} ; do
34    if test -f "${dir}/${pperl}" ; then
35      if `${dir}/${pperl} -v >/dev/null 2>&1` ; then
36        PERL="${dir}/${pperl}"
37        found_perl=1
38        break
39      fi
40    fi
41  done
42  if test $found_perl = 1 ; then
43    break
44  fi
45done
46 
47if [ .$1 = . ]
48then
49  SR=**APACHE_HOME_OS**
50  echo "Number of arguments should be 1. Provide the root directory for the web server."
51  exit 1
52else
53  SR=$1
54fi
55
56if [ -f $SR/bin/envvars ]
57then
58  echo "[Preserving existing envvars settings.]"
59  HAD_ENVVARS=yes
60else
61  HAD_ENVVARS=no
62fi
63
64sed -e "s%\*\*APACHE_HOME_OS\*\*%$SR%" $SR/conf/httpd.conf.in > $SR/conf/httpd.conf
65
66sed -e "s;^#!\@perlbin\@.*;#!$PERL;" -e "s;\@exp_installbuilddir\@;$SR/build;" \
67    apxs.in > $SR/bin/apxs
68
69PRE=`grep "^prefix = " build/config_vars.mk`
70PRE=`echo $PRE | sed -e "s;prefix = ;;"`
71sed -e "s;$PRE;$SR;" build/config_vars.mk > $SR/build/config_vars.mk.tmp
72mv $SR/build/config_vars.mk.tmp $SR/build/config_vars.mk
73chmod u+rwx $SR/build/config_vars.mk
74
75sed -e "s;^#!/.*;#!$PERL;" bin/dbmmanage > $SR/bin/dbmmanage.tmp
76mv $SR/bin/dbmmanage.tmp $SR/bin/dbmmanage
77
78sed -e "s%\*\*APACHE_HOME_OS\*\*%$SR%" \
79        -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bin/apachectl > $SR/bin/apachectl.tmp
80mv $SR/bin/apachectl.tmp $SR/bin/apachectl
81chmod u+rwx $SR/bin/apachectl
82
83sed -e "s%\*\*APACHE_HOME_OS\*\*%$SR%" \
84        bin/envvars-std > $SR/bin/envvars-std.tmp
85mv $SR/bin/envvars-std.tmp $SR/bin/envvars-std
86chmod u+rwx $SR/bin/envvars-std
87
88if [ $HAD_ENVVARS = no ]
89then
90    cp -p $SR/bin/envvars-std $SR/bin/envvars
91fi
92 
93echo "Ready."
94echo " +--------------------------------------------------------+"
95echo " | You now have successfully installed the Apache         |"
96echo " | HTTP server. To verify that Apache actually works      |"
97echo " | correctly you should first check the (initially        |"
98echo " | created or preserved) configuration files:             |"
99echo " |                                                        |"
100echo " |   $SR/conf/httpd.conf"
101echo " |                                                        |"
102echo " | You should then be able to immediately fire up         |"
103echo " | Apache the first time by running:                      |"
104echo " |                                                        |"
105echo " |   $SR/bin/apachectl start "
106echo " |                                                        |"
107echo " | Thanks for using Apache.       The Apache Group        |"
108echo " |                                http://www.apache.org/  |"
109echo " +--------------------------------------------------------+"
110echo " "
Note: See TracBrowser for help on using the browser.