The rewrite rule is different. Something like:

RewriteRule ^(*.)/(*.)/(*.) http://localhost:8080/perl-bb/script.pl?a=$1&b=$2&c=$3 [P]

However, I worked around the issue and used a ProxyPass to pass the request to the backend and _then_ do the rewrite. The handler is also different.

-Jon

Philip M. Gollucci wrote:

Philip M. Gollucci wrote:

     [error] slurp_filename('/opt/apache2/perl/script.pl?a=a&b=b&c=c')
     / opening: (2) No such file or directory at
     /opt/perl/lib/site_perl/5.8.7/i686-linux/ModPerl/RegistryCooker.pm
     line 540

This works for me if I am understanding you correctly.

Okay, so I've got this setup
perl 5.8.7 no ithread
apache 2.0.54 apr not threaded
mp2-svn

I've got httpd.conf and httpd_mp2.conf

httpd.conf:
Listen 80
RewriteEngine On
RewriteLog "......./logs/rewrite_log"
ErrorLog   "......./logs/error_log"
RewriteLogLevel 3

RewriteRule search/a/b/c http://localhost:8080/perl-bb/script.pl?a=a&b=b&c=c [P]

httpd_mp2.conf
Listen 8080
ErrorLog "......./logs/error_log_mp2"
Load perl_module modules/mod_perl.so

Alias  /perl-bb/ ....../perl-bb/
<Location /perl-bb/>
  SetHandler perl-script
  PerlResponseHandler ModPerl::RegistryBB
  Options +ExecCGI
  Allow from all
</Location>

Start the Servers
sudo bin/httpd -f httpd.conf
bin/httpd -f httpd_mp2.conf

Request
curl http://localhost/search/a/b/c

Access Log
httpd.conf:80
127.0.0.1 - - [01/Oct/2005:01:23:54 -0400] "GET /search/a/b/c HTTP/1.1" 200 33 127.0.0.1 - - [01/Oct/2005:01:23:54 -0400] "GET /search/a/b/c HTTP/1.1" 200 33 "-" "curl/7.13.1 (i386-portbld-freebsd5.4) libcurl/7.13.1 OpenSSL/0.9.7e zlib/1.2.1"

httpd_mp2.conf:8080
127.0.0.1 - - [01/Oct/2005:01:23:54 -0400] "GET /perl-bb/script.pl?a=a&b=b&c=c HTTP/1.1" 200 33 127.0.0.1 - - [01/Oct/2005:01:23:54 -0400] "GET /perl-bb/script.pl?a=a&b=b&c=c HTTP/1.1" 200 33 "-" "curl/7.13.1 (i386-portbld-freebsd5.4) libcurl/7.13.1 OpenSSL/0.9.7e zlib/1.2.1"

The server Error Logs
httpd.conf:80
[Sat Oct 01 01:23:35 2005] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 01 01:23:35 2005] [notice] Digest: done
[Sat Oct 01 01:23:35 2005] [notice] Apache/2.0.54 (Unix) DAV/2 configured -- resuming normal operations
[Sat Oct 01 01:23:35 2005] [info] Server built: Sep 30 2005 20:27:31
[Sat Oct 01 01:23:35 2005] [debug] prefork.c(956): AcceptMutex: flock (default: flock) [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(67): proxy: HTTP: canonicalising URL //localhost:8080/perl-bb/script.pl [Sat Oct 01 01:23:54 2005] [debug] mod_proxy.c(418): Trying to run scheme_handler [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(1059): proxy: HTTP: serving URL http://localhost:8080/perl-bb/script.pl?a=a&b=b&c=c [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(186): proxy: HTTP connecting http://localhost:8080/perl-bb/script.pl?a=a&b=b&c=c to localhost:8080 [Sat Oct 01 01:23:54 2005] [debug] proxy_util.c(1139): proxy: HTTP: fam 2 socket created to connect to localhost [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(336): proxy: socket is connected [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(370): proxy: connection complete to 127.0.0.1:8080 (localhost) [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(893): proxy: start body send [Sat Oct 01 01:23:54 2005] [debug] proxy_http.c(953): proxy: end body send

httpd_mp2.conf:8080
[Sat Oct 01 01:23:41 2005] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 01 01:23:41 2005] [notice] Digest: done
[Sat Oct 01 01:23:41 2005] [warn] pid file /usr/home/pgollucci/httpd/2.0.54/prefork/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sat Oct 01 01:23:41 2005] [notice] Apache/2.0.54 (Unix) DAV/2 mod_perl/2.0.2-dev Perl/v5.8.7 configured -- resuming normal operations
[Sat Oct 01 01:23:41 2005] [info] Server built: Sep 30 2005 20:27:31
[Sat Oct 01 01:23:41 2005] [debug] prefork.c(956): AcceptMutex: flock (default: flock)


The rewrite Log
127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (2) init rewrite engine with requested uri /search/a/b/c 127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (3) applying pattern 'search/a/b/c' to uri '/search/a/b/c' 127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (2) rewrite /search/a/b/c -> http://localhost:8080/perl-bb/script.pl?a=a&b=b&c=c 127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (3) split uri=http://localhost:8080/perl-bb/script.pl?a=a&b=b&c=c -> uri=http://localhost:8080/perl-bb/script.pl, args=a=a&b=b&c=c 127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (2) forcing proxy-throughput with http://localhost:8080/perl-bb/script.pl 127.0.0.1 - - [01/Oct/2005:01:23:54 --0400] [localhost/sid#80a6dc8][rid#8169050/initial] (1) go-ahead with proxy request proxy:http://localhost:8080/perl-bb/script.pl [OK]




HTH






Reply via email to