You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Michael A Nachbaur <mi...@nachbaur.com> on 2003/09/08 23:53:19 UTC

Patch to Apache::TestConfig for Mandrake

I've created the following patch to help TestConfig.pm find the proper 
mod_perl httpd on Mandrake machines.  Mandrake installs both a 
/usr/sbin/httpd and /usr/sbin/httpd-perl, and includes configuration for 
mod_perl acceleration with a standard (e.g. non-mod_perl) httpd in front of 
it.

However, when Apache::Test is used, it finds /usr/sbin/httpd instead of the 
-perl one.  I've fixed this for my site, but so I don't run into this later 
(nor for others), I'm sending this patch to the list.

If you want to reply, please CC me, since I'm not on the list.

RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.171
diff -u -3 -p -r1.171 TestConfig.pm
--- TestConfig.pm       13 Aug 2003 19:02:51 -0000      1.171
+++ TestConfig.pm       8 Sep 2003 21:14:36 -0000
@@ -310,7 +310,13 @@ sub configure_httpd {
         for my $dir (map { $vars->{$_} } qw(sbindir bindir)) {
             next unless defined $dir;
             my $httpd = catfile $dir, $vars->{target};
-            next unless -x $httpd;
+            unless (-x $httpd) {
+                if (-x $httpd . '-perl') {
+                    $vars->{httpd} = $httpd . '-perl';
+                } else {
+                    next;
+                }
+            }
             $vars->{httpd} = $httpd;
             last;
         }

-- 
/* Michael A. Nachbaur <mi...@nachbaur.com>
 * http://nachbaur.com/pgpkey.asc
 */

"Rome wasn't burned in a day. "


Re: Patch to Apache::TestConfig for Mandrake

Posted by Stas Bekman <st...@stason.org>.
Michael A Nachbaur wrote:
> I've created the following patch to help TestConfig.pm find the proper 
> mod_perl httpd on Mandrake machines.  Mandrake installs both a 
> /usr/sbin/httpd and /usr/sbin/httpd-perl, and includes configuration for 
> mod_perl acceleration with a standard (e.g. non-mod_perl) httpd in front of 
> it.

Thanks for the patch, Michael. However I don't think we are going to submit to 
versatile imagination of each distro out there and hardcode all the possible 
variations. By guessing we may end up picking totally wrong things, so it's 
better to let the user explicitly specify what thing they want to use if it's 
not the standard name.

There is the -httpd command line option and the APACHE env var that allow to 
specify non-standard locations of httpd. Soon we will finish working out the 
one-time config feature where you will be able to tell where your httpd is 
once, and it'll be used since then. So Mandrake's perl will be able to 
pre-configure Apache::Test with that location.

> However, when Apache::Test is used, it finds /usr/sbin/httpd instead of the 
> -perl one.  I've fixed this for my site, but so I don't run into this later 
> (nor for others), I'm sending this patch to the list.
> 
> If you want to reply, please CC me, since I'm not on the list.
> 
> RCS file: 
> /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
> retrieving revision 1.171
> diff -u -3 -p -r1.171 TestConfig.pm
> --- TestConfig.pm       13 Aug 2003 19:02:51 -0000      1.171
> +++ TestConfig.pm       8 Sep 2003 21:14:36 -0000
> @@ -310,7 +310,13 @@ sub configure_httpd {
>          for my $dir (map { $vars->{$_} } qw(sbindir bindir)) {
>              next unless defined $dir;
>              my $httpd = catfile $dir, $vars->{target};
> -            next unless -x $httpd;
> +            unless (-x $httpd) {
> +                if (-x $httpd . '-perl') {
> +                    $vars->{httpd} = $httpd . '-perl';
> +                } else {
> +                    next;
> +                }
> +            }
>              $vars->{httpd} = $httpd;
>              last;
>          }
> 


-- 


__________________________________________________________________
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


Re: Patch to Apache::TestConfig for Mandrake

Posted by Michael A Nachbaur <mi...@nachbaur.com>.
Just after I sent the message, I saw the bug.  Just change:
     $vars->{httpd} = $httpd . "-perl"
to say instead:
     $httpd = $httpd . "-perl"

On Monday 08 September 2003 02:53 pm, Michael A Nachbaur wrote:
> I've created the following patch to help TestConfig.pm find the proper
> mod_perl httpd on Mandrake machines.  Mandrake installs both a
> /usr/sbin/httpd and /usr/sbin/httpd-perl, and includes configuration for
> mod_perl acceleration with a standard (e.g. non-mod_perl) httpd in front of
> it.
>
> However, when Apache::Test is used, it finds /usr/sbin/httpd instead of the
> -perl one.  I've fixed this for my site, but so I don't run into this later
> (nor for others), I'm sending this patch to the list.
>
> If you want to reply, please CC me, since I'm not on the list.
>
> RCS file:
> /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig
>.pm,v retrieving revision 1.171
> diff -u -3 -p -r1.171 TestConfig.pm
> --- TestConfig.pm       13 Aug 2003 19:02:51 -0000      1.171
> +++ TestConfig.pm       8 Sep 2003 21:14:36 -0000
> @@ -310,7 +310,13 @@ sub configure_httpd {
>          for my $dir (map { $vars->{$_} } qw(sbindir bindir)) {
>              next unless defined $dir;
>              my $httpd = catfile $dir, $vars->{target};
> -            next unless -x $httpd;
> +            unless (-x $httpd) {
> +                if (-x $httpd . '-perl') {
> +                    $vars->{httpd} = $httpd . '-perl';
> +                } else {
> +                    next;
> +                }
> +            }
>              $vars->{httpd} = $httpd;
>              last;
>          }

-- 
/* Michael A. Nachbaur <mi...@nachbaur.com>
 * http://nachbaur.com/pgpkey.asc
 */

"Ford," he said, "how many escape capsules are there?"
"None," said Ford.
Zaphod gibbered.
"Did you count them?" he yelled.
"Twice," said Ford