Re: Perl CGI and URL rewriting returning source instead of execution



On Monday 29 August 2005 19:20, Blake Girardot wrote:
> I have a perl cgi application, not mod_perl, but an actual .cgi application
> running under apache on OS X.
>
> As many web apps, it makes use of some long get requests with variable
> labels and values. For example:
>
> http://server.com/cgi-bin/app.cgi?t=new.htm&c=jlpnew.html
>
> I wrote a working url mod_rewrite rule for apache, but instead of the .cgi
> executing, it just returns the source code of the cgi.
>
[..]
>
> Any idea what I am doing wrong, why it just returns the cgi source text? It
> works fine with the actual urls, so I know everything is working normally,
> just not with the rewrite rule.

Hi Blake,

I'm not sure, but I think it might have to do with the order in which you're
loading the apache modules - I remember seeing something like this when I
tried to combine RewriteRules and mod_jk (which connects Apache with the
Tomcat servlet container) on Apache 1.x.

IIRC, all I had to do was to switch the order of the LoadModule lines, e.g.
something like this (OTTOMH):

LoadModule modules/mod_rewrite.so
LoadModule modules/mod_jk.so

HTH,

Philipp
.



Relevant Pages

  • Re: dynamic lib ignored even after "found" in "install_driver(Oracle) failed: Cant load..." cgi prob
    ... the solution i found is this: i moved the directory containing libclntsh.so under /usr/lib, which is a location that apache seems to trust, as opposed to where i had originally placed this directory. ... so, if i knew then what i know now, here are the steps _I_ would use were i to install the oracle instantclient such that the DBD::Oracle module would work when used in an apache 2.0 CGI: ... i also could run it this way by placing tnsnames.ora in my home directory as .tnsnames.ora, but this location will do me no good when i want apache to run the script as a cgi. ... am i missing some sort of configuration detail regarding apache and permissions granted a cgi? ...
    (perl.dbi.users)
  • Re: CGIs & CSS - References
    ... my $q = new CGI; ... > If the link tag method is considered to be sufficient, then hey, I'm ... (Naturally the stylesheets and js files are in both ... This makes me think it's Apache. ...
    (perl.beginners)
  • Re: Apache and Perl in Windows
    ... The cgi scripts execute, ... I am studying a spider book that uses Perl so I ... > file in apache and rename the jar files in the server directory. ...
    (comp.lang.perl.misc)
  • Perl DBI program fails unexpectedly in Apache CGI-mode *only*
    ... I have a Perl CGI-program which works perfectly under Apache on my ... appear only in the Apache CGI output: ... the program produces correct output in the command-line on ... both environments for "mysql.so" and 'libmysqlclient.so," produces ...
    (perl.dbi.users)
  • Re: Perl and IIS - script runs but The page cannot be displayed
    ... stew asked about CGI: the long answer is to perldoc CGI. ... Both the IIS and perl docs where crappy. ... I would love to have linux and apache etc but I'm stuck with a windows ...
    (comp.lang.perl.misc)