Skip Menu |

This queue is for tickets about the Apache-Test CPAN distribution.

Report information
The Basics
Id: 3861
Status: resolved
Priority: 0/
Queue: Apache-Test

People
Owner: Nobody in particular
Requestors: william [...] knowmad.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.03
Fixed in: (no value)



Subject: Custom t/conf/httpd.conf.in is ignored
After getting past the hurdle of notifying A::Test of the path to my httpd daemon, I now get the following error when testing: --------------------------------------------- waiting for server to start: .Syntax error on line 10 of /root/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf: Cannot load /usr/lib/apache/1.3/mod_log_config.so into server: /usr/lib/apache/1.3/mod_log_config.so: undefined symbol: ap_hook_status !!! server has died with status 1 (t/logs/error_log wasn't created, start the server in the debug mode) --------------------------------------------- Apparently my server needs to be configured for DSO support and have its modules compiled as DSO's. None of the docs mentioned these requirements and it is a surprising one given the fickleness of running mod_perl as a DSO (which is why all of my modules are compiled into the daemon). Anyhow, I saw in the README that I could create a custom httpd.conf file to use for testing. I copied the default t/conf/httpd.conf to t/conf/httpd.conf.in and removed the calls to LoadModule. I even deleted the original t/conf/httpd.conf file. However, my changes in the httpd.conf.in file were ignored when the new httpd.conf file was generated. Apparently the test is not using this file as its source for generating the httpd.conf file. Thanks, William
From: william [...] knowmad.com
Actually, reviewing the httpd.conf file further, it appears that my httpd.conf.in file is being used. However, the following lines are being appended to the top of the file (which is why I am getting an error starting the server): --------------------------------- LoadModule config_log_module "/usr/lib/apache/1.3/mod_log_config.so" LoadModule mime_magic_module "/usr/lib/apache/1.3/mod_mime_magic.so" LoadModule mime_module "/usr/lib/apache/1.3/mod_mime.so" LoadModule negotiation_module "/usr/lib/apache/1.3/mod_negotiation.so" LoadModule status_module "/usr/lib/apache/1.3/mod_status.so" LoadModule autoindex_module "/usr/lib/apache/1.3/mod_autoindex.so" LoadModule dir_module "/usr/lib/apache/1.3/mod_dir.so" LoadModule cgi_module "/usr/lib/apache/1.3/mod_cgi.so" LoadModule userdir_module "/usr/lib/apache/1.3/mod_userdir.so" LoadModule alias_module "/usr/lib/apache/1.3/mod_alias.so" LoadModule rewrite_module "/usr/lib/apache/1.3/mod_rewrite.so" LoadModule access_module "/usr/lib/apache/1.3/mod_access.so" LoadModule auth_module "/usr/lib/apache/1.3/mod_auth.so" LoadModule expires_module "/usr/lib/apache/1.3/mod_expires.so" LoadModule unique_id_module "/usr/lib/apache/1.3/mod_unique_id.so" LoadModule setenvif_module "/usr/lib/apache/1.3/mod_setenvif.so" User nobody Group nogroup ServerName localhost Port 8529 --------------------------------- Where are these getting set and how can I override them? Thanks, William
Date: Wed, 01 Oct 2003 16:28:07 -0700
From: Stas Bekman <stas [...] stason.org>
To: test-dev [...] httpd.apache.org, bug-Apache-Test [...] rt.cpan.org
Subject: Re: [Fwd: [cpan #3861] Custom t/conf/httpd.conf.in is ignored]
RT-Send-Cc:
Show quoted text
> This message about Apache-Test was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=3861 > > > Actually, reviewing the httpd.conf file further, it appears that my > httpd.conf.in file is being used. However, the following lines are being > appended to the top of the file (which is why I am getting an error > starting the server): > > --------------------------------- > LoadModule config_log_module "/usr/lib/apache/1.3/mod_log_config.so" > LoadModule mime_magic_module "/usr/lib/apache/1.3/mod_mime_magic.so" > LoadModule mime_module "/usr/lib/apache/1.3/mod_mime.so" > LoadModule negotiation_module "/usr/lib/apache/1.3/mod_negotiation.so" > LoadModule status_module "/usr/lib/apache/1.3/mod_status.so" > LoadModule autoindex_module "/usr/lib/apache/1.3/mod_autoindex.so" > LoadModule dir_module "/usr/lib/apache/1.3/mod_dir.so" > LoadModule cgi_module "/usr/lib/apache/1.3/mod_cgi.so" > LoadModule userdir_module "/usr/lib/apache/1.3/mod_userdir.so" > LoadModule alias_module "/usr/lib/apache/1.3/mod_alias.so" > LoadModule rewrite_module "/usr/lib/apache/1.3/mod_rewrite.so" > LoadModule access_module "/usr/lib/apache/1.3/mod_access.so" > LoadModule auth_module "/usr/lib/apache/1.3/mod_auth.so" > LoadModule expires_module "/usr/lib/apache/1.3/mod_expires.so" > LoadModule unique_id_module "/usr/lib/apache/1.3/mod_unique_id.so" > LoadModule setenvif_module "/usr/lib/apache/1.3/mod_setenvif.so" > > User nobody > Group nogroup > ServerName localhost > Port 8529 > --------------------------------- > > Where are these getting set and how can I override them?
They are inherited from your httpd.conf installed system-wide. You probably have a stale one. Once you remove it it won't inherit them any longer. Show quoted text
__________________________________________________________________ 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
Date: Wed, 01 Oct 2003 16:29:42 -0700
From: Stas Bekman <stas [...] stason.org>
To: test-dev [...] httpd.apache.org, Guest via RT <bug-Apache-Test [...] rt.cpan.org>
Subject: Re: [cpan #3861] Custom t/conf/httpd.conf.in is ignored
RT-Send-Cc:
Show quoted text
> This message about Apache-Test was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=3861 > > > After getting past the hurdle of notifying A::Test of the path to my > httpd daemon, I now get the following error when testing: > > --------------------------------------------- > waiting for server to start: .Syntax error on line 10 of > /root/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf: > Cannot load /usr/lib/apache/1.3/mod_log_config.so into server: > /usr/lib/apache/1.3/mod_log_config.so: undefined symbol: ap_hook_status > !!! > server has died with status 1 (t/logs/error_log wasn't created, start > the server in the debug mode) > --------------------------------------------- > > Apparently my server needs to be configured for DSO support and have its > modules compiled as DSO's. None of the docs mentioned these requirements > and it is a surprising one given the fickleness of running mod_perl as a > DSO (which is why all of my modules are compiled into the daemon).
No, as mentioned in the other followup. it inherits the httpd.conf settings from your global httpd.conf. Show quoted text
> Anyhow, I saw in the README that I could create a custom httpd.conf file > to use for testing. I copied the default t/conf/httpd.conf to > t/conf/httpd.conf.in and removed the calls to LoadModule. I even deleted > the original t/conf/httpd.conf file. However, my changes in the > httpd.conf.in file were ignored when the new httpd.conf file was > generated. Apparently the test is not using this file as its source for > generating the httpd.conf file. > > Thanks, > William >
-- Show quoted text
__________________________________________________________________ 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
[stas+old@stason.org - Wed Oct 1 19:28:43 2003]: Show quoted text
> They are inherited from your httpd.conf installed system-wide. You > probably have a stale one. Once you remove it it won't inherit them > any longer.
Yep, found and removed. Because I installed Apache as a package then reinstalled manually to /usr/local, I had the original conf file in /etc/apache/httpd.conf. With that file removed, I tried again and did not get all the LoadModule lines into my generated httpd.conf. However, I did continue to get the following lines: User nobody Group nobody I run my webserver as user www and don't know where these were being pulled from. I grepped the files in Apache::Test and didn't come across it either. However, I discovered that I could override the values as follows: t/TEST -httpd /usr/local/apache/bin/httpd -User www -Group www Thanks, William
Date: Fri, 03 Oct 2003 15:09:17 -0700
From: Stas Bekman <stas [...] stason.org>
To: bug-Apache-Test [...] rt.cpan.org, httpd-test-dev list <test-dev [...] httpd.apache.org>
Subject: Re: [cpan #3861] Custom t/conf/httpd.conf.in is ignored
RT-Send-Cc:
Guest via RT wrote: Show quoted text
> This message about Apache-Test was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=3861 > > > [stas+old@stason.org - Wed Oct 1 19:28:43 2003]: >
>>They are inherited from your httpd.conf installed system-wide. You >>probably have a stale one. Once you remove it it won't inherit them >>any longer.
> > > Yep, found and removed. Because I installed Apache as a package then > reinstalled manually to /usr/local, I had the original conf file in > /etc/apache/httpd.conf.
It proves again and again that guessing is evil :( Show quoted text
> With that file removed, I tried again and did not get all the LoadModule > lines into my generated httpd.conf. However, I did continue to get the > following lines: > User nobody > Group nobody > > I run my webserver as user www and don't know where these were being > pulled from. I grepped the files in Apache::Test and didn't come across > it either. However, I discovered that I could override the values as > follows: > > t/TEST -httpd /usr/local/apache/bin/httpd -User www -Group www
The logic comes from: Apache-Test/lib/Apache/TestConfig.pm If the server is run as non-root, it uses that user's uid/gid to configure. If run as root it tries 'nobody'. We could add 'www' as well, but someone may have both available, and others will have some other names. So again to avoid wrong guessing, probably the right solution is to inherit from the global httpd.conf, just like it inherits the LoadModule directives. Can you please try to fix that and send a patch? Show quoted text
__________________________________________________________________ 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
From: william [...] knowmad.com
[STAS - Fri Oct 3 18:09:53 2003]: Show quoted text
> It proves again and again that guessing is evil :(
LOL. Yeah, it's hard enough for an administrator to figure out how a system is configured. Capturing all that knowledge into a pgm is very difficult! At least it doesn't expose security risks like some systems are prone to do when guessing ;->. Show quoted text
> If the server is run as non-root, it uses that user's uid/gid to > configure. If > run as root it tries 'nobody'. We could add 'www' as well, but someone > may > have both available, and others will have some other names. So again > to avoid > wrong guessing, probably the right solution is to inherit from the > global > httpd.conf, just like it inherits the LoadModule directives. Can you > please > try to fix that and send a patch?
I'd be glad to try. Looking at Apache::TestConfig.pm I see a sub called default_user and default_group. Are these what I should be modifying? Where do you read in the LoadModule lines from the httpd.conf, if discovered? I'd like to use that as a template for finding the User and Group lines. William
Date: Fri, 03 Oct 2003 15:24:50 -0700
From: Stas Bekman <stas [...] stason.org>
To: bug-Apache-Test [...] rt.cpan.org
CC: httpd-test-dev list <test-dev [...] httpd.apache.org>
Subject: Re: [cpan #3861] Custom t/conf/httpd.conf.in is ignored
RT-Send-Cc:
Guest via RT wrote: Show quoted text
> This message about Apache-Test was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=3861 > > > [STAS - Fri Oct 3 18:09:53 2003]: >
>>It proves again and again that guessing is evil :(
> > > LOL. Yeah, it's hard enough for an administrator to figure out how a > system is configured. Capturing all that knowledge into a pgm is very > difficult! At least it doesn't expose security risks like some systems > are prone to do when guessing ;->.
Hopefully at the end we will get rid of all guesses, both in Apache-Test and modperl-2.0. I'm big +1 on that. Show quoted text
>>If the server is run as non-root, it uses that user's uid/gid to >>configure. If >>run as root it tries 'nobody'. We could add 'www' as well, but someone >>may >>have both available, and others will have some other names. So again >>to avoid >>wrong guessing, probably the right solution is to inherit from the >>global >>httpd.conf, just like it inherits the LoadModule directives. Can you >>please >>try to fix that and send a patch?
> > > I'd be glad to try. Looking at Apache::TestConfig.pm I see a sub called > default_user and default_group. Are these what I should be modifying? > Where do you read in the LoadModule lines from the httpd.conf, if > discovered? I'd like to use that as a template for finding the User and > Group lines.
You should be able to grep for this kind of tokens. It's coming from TestConfigParse.pm. Thank you. Show quoted text
__________________________________________________________________ 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
From: william [...] knowmad.com
[STAS - Fri Oct 3 18:25:27 2003]: Show quoted text
> You should be able to grep for this kind of tokens. It's coming from > TestConfigParse.pm.
Hi Stas, I've finally had a chance to take another look at parsing the httpd.conf file for the Group and User settings. I looked in the TestConfigParse.pm file; there's some nice, but complex, code in that module. From what I could figure out, the %wanted_config contains a hash of hashes which is used to parse the config file. The TAKE1 group appears to be made for retrieving a single key, so I added User and Group to that list. Now, however, I'm stuck. If I dump the vars hashref after running inherit_config, the values of User and Group are my user id 'william' (despite the fact that I'm running the script as root). I also looked at the value of User when it was being parsed inside of the inheret_config_file_or_directory sub. The script had the right values. I tried debugging but this part of the code is wrapped inside of an eval which sets ulimit before calling the script again. Is there a way to debug under this situation? So, I'm not sure what needs to happen to get the correct User and Group values into the vars hash. Sorry it's been so long but hopefully you can pick up the thread by reviewing the messages at rt.cpan.org. Now that I think about it, it could be that the parsing routine is getting the last User and Group values. Looking at my httpd.conf, this appears to be the case. However, those are settings for a VirtualHost which probably isn't what we want. We want the global User and Group settings which is typically(?) going to be the first value. So, how to skip further user and group lines in the parsing? Any suggestions? Thanks, William