Loading ...
Sorry, an error occurred while loading the content.
Skip to search.
 

Q about ProxyRemoteAddr

Expand Messages
  • jjunkin@datacrawler.com
    Hi! I am having difficulty setting cookies once we changed our production modperl system. We changed from a single machine front-end/backend setup two a two
    Message 1 of 2 , Dec 6 12:05 PM
      Hi!
      I am having difficulty setting cookies once we changed our production modperl system.
      We changed from a single machine front-end/backend setup two a two machine setup
      Both use apache 2.x for the front server on ports 80 and 443, and modperl 1.3.x server running on ports 8001,8000.
       
      The problem is only occurring on the 2 machine setup with server 1 running apache 2.x using proxypass and modrewrite to proxy back to server 2.
       
      The problem is: after the server is restarted, cookies are set just fine. But, after each of the new child processes have been used, cookies are no longer set. The Perl application continues to see the client's existing cookie, but new cookies are not set.
       
      Here are some questions:
      1)
      If I am using Apache 2.x, do I still need to compile in mod_proxy_add_forward  to the apache server? I was somehow under the impression that this exists under apache2.x.
       
      2)
      In the lines of the example preload.pl script it shows
       
       unless ($r->connection->remote_ip eq "127.0.0.1") and $r->header_in('X-Forwarded-For');
       
      I assume that this setup (127.0.0.1) is for when both versions of apache are run on the same machine?
       
      If I have a 2 machine setup with server1_ip_addr and server2_ip_addr then I should have:
       
       unless ($r->connection->remote_ip eq "server1_ip_addr") and $r->header_in('X-Forwarded-For');
       
      Is this correct? The docs don't make this clear.
       
      Sorry for so many questions. I have searched the mailing list and cannot find the answers to these questions.
       
      Thanks,
       
      Joe Junkin
    • Stas Bekman
      ... Yes, integrated in mod_proxy in Apache2. http://perl.apache.org/docs/2.0/user/handlers/http.html#Misc_Notes ... Yes. ... Yes. Patches to make things more
      Message 2 of 2 , Dec 8 3:38 PM
        jjunkin@... wrote:
        > Hi! I am having difficulty setting cookies once we changed our
        > production modperl system. We changed from a single machine
        > front-end/backend setup two a two machine setup Both use apache 2.x for
        > the front server on ports 80 and 443, and modperl 1.3.x server running
        > on ports 8001,8000.
        >
        > The problem is only occurring on the 2 machine setup with server 1
        > running apache 2.x using proxypass and modrewrite to proxy back to
        > server 2.
        >
        > The problem is: after the server is restarted, cookies are set just
        > fine. But, after each of the new child processes have been used,
        > cookies are no longer set. The Perl application continues to see the
        > client's existing cookie, but new cookies are not set.
        >
        > Here are some questions: 1) If I am using Apache 2.x, do I still need
        > to compile in mod_proxy_add_forward to the apache server? I was
        > somehow under the impression that this exists under apache2.x.

        Yes, integrated in mod_proxy in Apache2.
        http://perl.apache.org/docs/2.0/user/handlers/http.html#Misc_Notes

        > 2) In the lines of the example preload.pl script it shows
        >
        > unless ($r->connection->remote_ip eq "127.0.0.1") and
        > $r->header_in('X-Forwarded-For');
        >
        > I assume that this setup (127.0.0.1) is for when both versions of
        > apache are run on the same machine?

        Yes.

        > If I have a 2 machine setup with server1_ip_addr and server2_ip_addr
        > then I should have:
        >
        > unless ($r->connection->remote_ip eq "server1_ip_addr") and
        > $r->header_in('X-Forwarded-For');
        >
        > Is this correct? The docs don't make this clear.

        Yes. Patches to make things more clear are welcome. When I wrote that I
        had only one machine.

        > Sorry for so many questions. I have searched the mailing list and
        > cannot find the answers to these questions.

        No worries :)

        --
        __________________________________________________________________
        Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        mailto:stas@... http://use.perl.org http://apacheweek.com
        http://modperlbook.org http://apache.org http://ticketmaster.com

        --
        Report problems: http://perl.apache.org/bugs/
        Mail list info: http://perl.apache.org/maillist/modperl.html
        List etiquette: http://perl.apache.org/maillist/email-etiquette.html
      Your message has been successfully submitted and would be delivered to recipients shortly.