The easiest way I've found to do this in Apache::Test is attached. It extracts the "PREFIX" from apxs and uses that as the default inherited ServerRoot value. If a value is hard-coded into the global httpd.conf, it supercedes the apxs value and everything works just like before.
hmm. it looks like PREFIX is only related to the installation, whereas ServerRoot, if not specified, is hard-coded to /usr/local/apache (according to include/httpd.h in 2.0). so, PREFIX isn't much help if one installs then moves the binaries to a new location.
If they move .so modules to a different location without defining ServerRoot things won't work.
but I suppose that a guess is better than nothing if we don't have a ServerRoot to pull from the default httpd.conf, and PREFIX and ServerRoot match for me :)
-1 on adding any new guesswork. So far it was causing more damage than it was adding value. But this is not a guesswork. If ServerRoot is not specified PREFIX should be the one, since this is what Apache is doing. So use that and verify that the files can be found. If not, complain that ServerRoot can't be determined and die.
I'm not sure it's a good idea to just:
+ $self->{inherit_config}->{ServerRoot} ||= $self->apxs('PREFIX');may be better to use PREFIX if ServerRoot is not defined in the code where it's needed, so it'll be clear that we don't have ServerRoot defined. And if we fail to expand paths we can tell a user the reason. If we have ServerRoot=PREFIX we can't tell the real reason to the user.
btw, doesn't it seem strange that prefix defaults to /usr/local/apache2 in config.layout but ServerRoot defaults to /usr/local/apache? hmm...
Sounds like a porting to httpd 2.0 bug. But since the majority specifies ServerRoot nobody has noticed it. Report to httdp-dev?
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
