httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: A-T: httpd.conf.in
Date Sat, 22 Jan 2005 01:15:13 GMT
Oden Eriksson wrote:

Sorry for dropping out of site, hardware problems here, my notebook is 
dead again :( too much modperl smoking is not good for a notebook's 
health. I wish somebody was sending me a new one :)

>>>The server fails to start, but that's something else. I noticed though
>>>that if the /etc/httpd/conf/httpd.conf exists A-T is trying to inherit
>>>that config (inherit_config) but this fails as this file is for
>>>apache-1.x. Shouldn't something from "httpd2 -V" be used instead?
>>
>>Take a look at: lib/Apache/TestConfigParse.pm:sub inherit_config {
>>it should find the correct global config file, please check that code to
>>see if something goes wrong.
> 
> 
> I looked at it but it's hard to understand. I couldn't find where it actually 
> looks for the httpd.conf file.

it's right here:

1)    my $file = $self->{vars}->{httpd_conf};

2)    unless ($file and -e $file) {
         if (my $base = $self->{httpd_basedir}) {
             my $default_conf = $self->{httpd_defines}->{SERVER_CONFIG_FILE};
             $default_conf ||= catfile qw(conf httpd.conf);
             $file = catfile $base, $default_conf;
             # SERVER_CONFIG_FILE might be an absolute path
             $file = $default_conf if !-e $file and -e $default_conf;
         }
     }

(1) is set if you've passed an explicit -httpd_conf option to t/TEST (or 
perl Makefile.PL). otherwise (2) is invoked, so you can see that it gets 
the base dir of the server and looks for conf/httpd.conf under it. So in 
your case it's probably that httpd_basedir gets a wrong value. The latter 
gets set in TestConfig.pm:

     if ($vars->{httpd}) {
         my @chunks = splitdir $vars->{httpd};
         #handle both $prefix/bin/httpd and $prefix/Apache.exe
         for (1,2) {
             pop @chunks;
             last unless @chunks;
             $self->{httpd_basedir} = catfile @chunks;
             last if -d "$self->{httpd_basedir}/bin";
         }
     }

so it tries to find the root of the Apache install.

As this of any help?

>>>Also the mod_perl module as all other code is built as non root, so
>>>certain files and directories can't be access. The snipppet above solves
>>>some of that.
>>
>>A-T handles that internally. See
>>
>>   lib/Apache/TestRun.pm:sub adjust_t_perms {
>>
>>if you intervene with normal process, then you are on your own.
>>
>>I still can't understand what's wrong with the autogenerated httpd.conf,
>>that you need to write your own. Please explain.
> 
> 
> Ok. As it cannot find the correct httpd.conf file I have to do it like this. 
> But I suspect even if it would, it wouldn't work anyway as we use two main 
> config files and includes specific module config files using the scandir 
> feature (Include conf.d/*.conf). 

And A-T should be able to do that just fine.

> SUSE does it like that too, as well as 
> RedHat, PLD, ALTLinux, and perhaps many more. As a non root user I do not 
> have permissions to write a PidFile or LockFile unless it's in a directory I 
> have permissions to.

I don't understand that. Both PidFile or LockFile are rewritten by A-T to 
point to t/logs/ check TestConfig.pm's __DATA__ section. There should be 
no perms problems.

> I would be happy if I could disable this inherit_config thing so it does not 
> search for any configuration files at all.

it's easy: just pass your specific -httpd_conf option and point it to the 
file that you create by yourself.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message