Bug 53059 - Make httpd easier relocatable by using a variable sbindir
Summary: Make httpd easier relocatable by using a variable sbindir
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2012-04-10 23:24 UTC by Igor Galić
Modified: 2012-04-11 09:53 UTC (History)
0 users



Attachments
variable sbindir (798 bytes, patch)
2012-04-10 23:24 UTC, Igor Galić
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Galić 2012-04-10 23:24:08 UTC
Created attachment 28577 [details]
variable sbindir

In order to be easily relocatable, make apachectl use a variable sbindir.

That way we can ./configure --prefix=/opt/foo && make && make install

and then cp -r /opt/foo /opt/bar and have a new instance to run with.
Comment 1 Igor Galić 2012-04-11 09:53:42 UTC
I have made slight modifications to this patchset -- to actually work. - But of course it only works with the default layout:

bin/apachectl:

  HTTPD="$SBINDIR/httpd"
  #
  # pick up any necessary environment variables
  if test -f $SBINDIR/envvars; then
    . $SBINDIR/envvars
  fi

  if test "x$SERVER_ROOT" != "x"; then
    HTTPD="$HTTPD -d $SERVER_ROOT"
  fi


bin/envvars:

  envvars=$( readlink -f $0 )
  export SERVER_ROOT=${envvars%*/*/*}

conf/httpd.conf:

  ServerRoot "${SERVER_ROOT}"
  DocumentRoot "${SERVER_ROOT}/htdocs"
  # .. etc..