Loading ...
Sorry, an error occurred while loading the content.

Re: proxy question: URL with parameters

Expand Messages
  • Philip M. Gollucci
    ... I will get to looking at it, but I haven t had time yet. Look for a response from me Sat-Sun. -- END ... What doesn t kill us can only make us stronger.
    Message 1 of 10 , Oct 21, 2005
    • 0 Attachment
      Eric Lenio wrote:
      > Well the main reason is simple: I like programming in Perl and so I
      > specifically want to learn more about mp2. mod_proxy is of limited use to me
      > because eventually I will want to do some sophisticated URL rewriting. For now
      > I want to get my example working, then on to more advanced things (where I can
      > tap into Perl's vast set of features & modules). I don't *want* to learn the
      > ins & outs of mod_proxy or mod_rewrite; I want to do it the Perl way.
      >
      > 2 people have now questioned why I am using mod_perl for the solution... this
      > is strange to me because I expect people on this list to look for EXCUSES to
      > use mp2... come on, how about some mp2 advocacy???
      I will get to looking at it, but I haven't had time yet. Look for a
      response from me Sat-Sun.

      --
      END
      ---------------------------------------------------------
      What doesn't kill us can only make us stronger.
      Nothing is impossible.

      Philip M. Gollucci (pgollucci@...) 301.254.5198
      Consultant / http://p6m7g8.net/Resume/resume.shtml
      Senior Developer / Liquidity Services, Inc.
      http://www.liquidityservicesinc.com
      http://www.liquidation.com
      http://www.uksurplus.com
      http://www.govliquidation.com
      http://www.gowholesale.com
    • Perrin Harkins
      ... I think it s natural to wonder why you aren t using tools like mod_proxy and mod_rewrite that specifically handle this problem and are widely used. You
      Message 2 of 10 , Oct 21, 2005
      • 0 Attachment
        On Fri, 2005-10-21 at 16:00 -0400, Eric Lenio wrote:
        > 2 people have now questioned why I am using mod_perl for the solution... this
        > is strange to me because I expect people on this list to look for EXCUSES to
        > use mp2... come on, how about some mp2 advocacy???

        I think it's natural to wonder why you aren't using tools like mod_proxy
        and mod_rewrite that specifically handle this problem and are widely
        used. You didn't mention anything that those modules can't do in your
        previous message. Many of us run a slim proxy server in front of
        mod_perl, and avoid putting mod_perl into it so that we can avoid the
        extra memory it would consume.

        You have reasons for your choice, so that's fine, but the suggestions to
        consider using mod_proxy were good suggestions given the information you
        supplied. I don't really want to see blind advocacy of mod_perl.

        - Perrin
      • Philippe M. Chiasson
        ... my $real_url = $r- uri; There is no need to put query arguments in the url, mod_proxy will pick it up from $r itself. ... -- Philippe M. Chiasson
        Message 3 of 10 , Oct 21, 2005
        • 0 Attachment
          Eric Lenio wrote:
          > On Thu, Oct 20, 2005 at 10:47:02PM -0400, Philip M. Gollucci wrote:
          >
          >>Eric Lenio wrote:
          >>
          >>>The handler converts the question mark to %3f and the proxy request
          >>>basically
          >>>fails. I'm using modperl 1.99.11, I'd like to fix this before moving in to
          >>>2.0.2. Suggestions?
          >>
          >>Post the relevant configs please.
          >
          >
          > Here are the key parts of the code. Anything else Philip?
          >
          > package LenioApache::RewriteURI;
          >
          > use strict;
          > use warnings;
          >
          > use Apache::RequestRec ();
          >
          > use Apache::Const -compile => qw(DECLINED :common);
          >
          > sub handler {
          > my $r = shift;
          > my $hostname = $r->hostname;
          > my $port = $r->get_server_port;
          > my $real_url = $r->unparsed_uri;

          my $real_url = $r->uri;

          There is no need to put query arguments in the url, mod_proxy will
          pick it up from $r itself.

          > if ($hostname =~ m{^hplg2\.}i) {
          > $r->proxyreq(1);
          > $r->uri($real_url);
          > $r->filename(sprintf "proxy:http://192.168.0.4:8080%s",$real_url);
          > $r->handler('proxy-server');
          > return Apache::OK;
          > }
          > return Apache::DECLINED;
          > }
          > 1;
          >


          --
          Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
          http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
        • Adam Prime x443
          For the record Apache::ProxyRewrite is a mod_perl solution, and it would probably be extremely quick to port it to mp2. At minimum, it might be a good place
          Message 4 of 10 , Oct 21, 2005
          • 0 Attachment
            For the record Apache::ProxyRewrite is a mod_perl solution, and it would probably be extremely quick to port it to mp2. At minimum, it might be a good place to start for your custom handler.

            http://search.cpan.org/~cgilmore/Apache-ProxyRewrite-0.17/ProxyRewrite.pm

            Adam

            -----Original Message-----
            From: Perrin Harkins [mailto:perrin@...]
            Sent: Fri 10/21/2005 6:23 PM
            To: Eric Lenio
            Cc: modperl@...
            Subject: Re: proxy question: URL with parameters
            On Fri, 2005-10-21 at 16:00 -0400, Eric Lenio wrote:
            > 2 people have now questioned why I am using mod_perl for the solution... this
            > is strange to me because I expect people on this list to look for EXCUSES to
            > use mp2... come on, how about some mp2 advocacy???

            I think it's natural to wonder why you aren't using tools like mod_proxy
            and mod_rewrite that specifically handle this problem and are widely
            used. You didn't mention anything that those modules can't do in your
            previous message. Many of us run a slim proxy server in front of
            mod_perl, and avoid putting mod_perl into it so that we can avoid the
            extra memory it would consume.

            You have reasons for your choice, so that's fine, but the suggestions to
            consider using mod_proxy were good suggestions given the information you
            supplied. I don't really want to see blind advocacy of mod_perl.

            - Perrin
          Your message has been successfully submitted and would be delivered to recipients shortly.