Mailing List Archive

[Bug 8508] New: - apxs generates incorrect LoadModule directive.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8508>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8508

apxs generates incorrect LoadModule directive.

Summary: apxs generates incorrect LoadModule directive.
Product: Apache httpd-1.3
Version: HEAD
Platform: All
OS/Version: All
Status: NEW
Severity: Critical
Priority: Other
Component: Other
AssignedTo: bugs@httpd.apache.org
ReportedBy: Mark.Stracey@futuretv.com
CC: Mark.Stracey@futuretv.com


If apxs is used to activate a module in httpd.conf, the path to {CFG_}LIBEXECDIR
is checked to see if it begins with {CFG_}PREFIX, and if so then {CFG_}PREFIX is
stripped from the module path in the generated LoadModule directive. httpd then
sees the relative path and prefixes it with ServerRoot {CFG_}SYSCONFDIR.

If - like many apache installations - the config, log and binary files are kept
in separate directories, then this results in an attempt to load a non-existant
module from ServerRoot/{LIBEXECDIR - PREFIX}.

This behaviour has been seen on Debian Linux 2.2 (apache package version
1.3.9-14) and Solaris (Solaris 8 10/01, package SUNWapch{u|r} version
11.8.0,REV=2000.01.08.18.12)

'Guilty' lines in apxs:

466: my $dir = $CFG_LIBEXECDIR;
467: $dir =~ s|^$CFG_PREFIX/?||;
468: $dir =~ s|(.)$|$1/|;
469: push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));

The workaround I'm using (in Solaris PHP4 package postinstall script) is to
substitute the value of PREFIX on the apxs command line:

apxs -S PREFIX=/foo -e -n php4 -a /usr/apache/libexec/libphp4.so