httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Fee" <>
Subject Eliminating absolute paths on installation
Date Wed, 13 Dec 2006 12:16:35 GMT
Hello all,

After building Apache httpd, I find that the httpd executable has explicit knowledge of its
ultimate install location as specified with:

./configure --prefix=<install location>

Items with this absolute knowledge include:
ServerRoot (e.g. httpd implicitly know where to find its config file.)
RPATH (used by the dynamic linker to locate APR libraries.)

This is a problem for me as the install location is not always known at build time.  Also,
if I give someone a built version of httpd, they can not install it multiple times on one
host due to the absolute paths.

I expect the ServerRoot item could easily cope with relative paths.  Whether the starting
point is the current working directory or the directory in which the httpd application resides
can be up for debate.

The RPATH is slightly different.

Before installation libtool creates a script "httpd" which can be used to run the real httpd
which is in the .libs directory.  It uses LD_LIBRARY_PATH to temporarily override the RUNPATH
stored within the ELF object.  However LD_LIBRARY_PATH should be avoided in general use.

The RPATH is populated by the -R (or -rpath) linker option.  $ORIGIN is a token which the
runtime linker interprets as the directory in which the ELF object resides.

The current RPATH can be seen with:
(Linux) objdump -p httpd | grep PATH
(Solaris) dump -Lv httpd | grep PATH
  RPATH   <install root>/lib

Replacing this with $ORIGIN/../lib would cause the httpd executable to search for the APR
libraries in ../lib relative to itself.

Hence we could now build Apache httpd without advanced knowledge of where it is to be installed.
 This would be very useful for me.

Any thoughts?


Surf the Web in a faster, safer and easier way:
Download Opera 9 at

Powered by Outblaze

View raw message