ManagedLinks has asked for the wisdom of the Perl Monks concerning the following question:
The script is called by lots of clients on different web servers So I cannot easily change the location of the script to /perl/
An easy fix or so I thought was to rewrite the url using mod rewrite so that the server would look for the script in the correct directory (/perl/) rather than the requested directory (/cgi-bin/)
I inserted this into httpd.conf in the virtual server configuration
<code>#redirect mlserver requests to the faster mod_perl
RewriteEngine on
RewriteRule ^/cgi-bin/mlserver.pl(.*) /perl/mlserver.pl$1</code>
Bonza it worked
But then I realised it was still running under CGI not mod_perl!
Now I cannot find a way to get the script running under mod_perl. CGI always
takes over!
If I remove the shebang line the script fails
If I call it directly ie: server.com/perl/mlserver.pl it works correctly under
mod_perl
How can I redirect an incoming request to the new mod_perl script?
I know this question is probably more an apache one, but I hope someone here can assist
I have tried renaming the script to mlserver.perl and the setting a new handler
ie: AddHandler perl-script .perl
but all that does is send back plain text, it doesn't execute mod_perl at all
Any ideas apart from telling all my clients to change the code on hundreds of sites?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Seems simple enough how do I redirect old cgi scripts to mod perl?
by skx (Parson) on Sep 30, 2005 at 12:50 UTC | |
by jhourcle (Prior) on Sep 30, 2005 at 16:47 UTC | |
|
Re: Seems simple enough how do I redirect old cgi scripts to mod perl?
by rvosa (Curate) on Sep 30, 2005 at 13:20 UTC | |
|
Re: Seems simple enough how do I redirect old cgi scripts to mod perl?
by cbrandtbuffalo (Deacon) on Sep 30, 2005 at 11:43 UTC | |
|
Re: Seems simple enough how do I redirect old cgi scripts to mod perl?
by perrin (Chancellor) on Sep 30, 2005 at 18:42 UTC | |
by ManagedLinks (Initiate) on Oct 01, 2005 at 00:07 UTC |