Bug 53059

Summary: Make httpd easier relocatable by using a variable sbindir
Product: Apache httpd-2 Reporter: Mina Galić <me>
Component: supportAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: variable sbindir

Description Mina 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 Mina 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..