Hi,

Marc has recently discovered [0], that Torrus Debian packages do not work with apache2. I have looked a bit into the issue and it appears that starting with version 1.999.22 the API of mod_perl2 module has changed, causing the problems. After a bit of tinkering and with the help of the old-to-new API transition page [1], I was able to fix torrus up, so that it now appears to work with apache2. A very lightly tested patch (from the category "works for me" :-) is attached.
[0] http://bugs.debian.org/318847
[1] http://perl.apache.org/docs/2.0/rename.html

Best regards,

Jurij Smakov                                        [EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
diff -aur a/configs/webmux2.pl b/configs/webmux2.pl
--- a/configs/webmux2.pl        2005-01-25 08:46:27.000000000 -0500
+++ b/configs/webmux2.pl        2005-07-18 20:21:13.000000000 -0400
@@ -21,9 +21,8 @@
 
 BEGIN { require '@torrus_config_pl@'; }
 
-use Apache2;
-use Apache::ServerUtil;
-use mod_perl;
+use Apache2::ServerUtil;
+use mod_perl2;
 
 use Torrus::Log;
 use Torrus::DB;
@@ -50,7 +49,7 @@
 }
 
 my $ok = 1;
-my $s = Apache->server();
+my $s = Apache2::ServerUtil->server();
 
 # Apache::Server::is_perl_option_enabled is implemented since
 # mod_perl2-1.99r13, but many installations still use mod_perl2-1.99r12
diff -aur a/perllib/Torrus/Apache2Handler.pm b/perllib/Torrus/Apache2Handler.pm
--- a/perllib/Torrus/Apache2Handler.pm  2005-07-18 12:24:59.000000000 -0400
+++ b/perllib/Torrus/Apache2Handler.pm  2005-07-18 20:22:25.000000000 -0400
@@ -22,18 +22,17 @@
 package Torrus::Apache2Handler;
 
 use strict;
-use Apache2;
 
-use Apache::RequestRec;
-use Apache::RequestIO;
-use Apache::RequestUtil;
-use Apache::Const -compile => qw(:common);
+use Apache2::RequestRec;
+use Apache2::RequestIO;
+use Apache2::RequestUtil;
+use Apache2::Const -compile => qw(:common);
     
 # This is actually not a part of mod_perl
 use Apache::Session::File;
 
 # libapreq2
-use Apache::Request;
+use Apache2::Request;
 
 use Torrus::Log;
 use Torrus::Renderer;
@@ -49,7 +48,7 @@
         print STDERR $r->as_string();
     }
     
-    my $apr = Apache::Request->new($r);
+    my $apr = Apache2::Request->new($r);
 
     my @paramNames = $apr->param();
 
@@ -75,7 +74,7 @@
         $Torrus::ApacheHandler::renderer = new Torrus::Renderer();
         if( not defined( $Torrus::ApacheHandler::renderer ) )
         {
-            return Apache::SERVER_ERROR;
+            return Apache2::Const::SERVER_ERROR;
         }
     }
 
@@ -228,7 +227,7 @@
         undef $options{'acl'};
     }
 
-    my $retval = Apache::OK;
+    my $retval = Apache2::Const::OK;
 
     if( defined($fname) )
     {
@@ -244,7 +243,7 @@
     }
     else
     {
-        $retval = Apache::SERVER_ERROR;
+        $retval = Apache2::Const::SERVER_ERROR;
     }
     
     if( not $Torrus::Renderer::globalDebug )
@@ -264,7 +263,7 @@
     $r->no_cache(1);
     $r->content_type('text/plain');
     $r->print('Error: ' . $msg);
-    return Apache::OK;
+    return Apache2::Const::OK;
 }
 
 

Reply via email to