FAQ
I'm trying to achieve the following setup (with apache+mod_perl)
- one server in front: http://front/myapp, serving the static content
and proxying for several instances in the back-end.
- several instances of the application in the back-end, but each with a
different purpose. i.e., the user knows what instance he wants to
reach, and says so in the URL:
- http://front/myapp/A/...
- http://front/myapp/B/...

The aim is to be able to split the load on different machines, if need
be. However, currently, there is no such need, so A and B would be
hosted on the same machine, possibly even the front-end machine.

So I'd need to install one Catalyst app that can be reached either as
/myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
path it has been accessed (because it's behaviour will be slightly
different whether it's A or B).

I already tried with mod_rewrite and [P], but then uri_for() still
refers to /myapp on the back-end server (not /myapp/A on the front-end).
I know I read everywhere that under mod_perl, it should Just Work, well
it bloody well doesn't! I have to resign to messing around with
$c->req->base, but it's not dynamic: I can set it to a string read from
the config, but I couldn't figure out how to determine what the original
request was aimed at (was it /A? /B?).

I guess I failed to understand something in mod_proxy or Catalyst
configuration, but I also failed at finding the documentation that
explains how to do that. If someone can point me in the right
direction... Please?

--
C é d r i c B o u v i e r
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070209/f3680640/attachment.pgp

Search Discussions

  • Perrin Harkins at Feb 9, 2007 at 1:17 pm

    On 2/9/07, C?dric Bouvier wrote:
    So I'd need to install one Catalyst app that can be reached either as
    /myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
    path it has been accessed (because it's behaviour will be slightly
    different whether it's A or B).
    It sounds to me like you want virtual hosts. You can check the host
    header to see which one you're in, or use PerlSetVar inside the
    VirtualHost block to set a perl variable indicating which one.

    - Perrin
  • Bill Moseley at Feb 9, 2007 at 3:45 pm

    On Fri, Feb 09, 2007 at 10:40:39AM +0100, C?dric Bouvier wrote:
    So I'd need to install one Catalyst app that can be reached either as
    /myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
    path it has been accessed (because it's behaviour will be slightly
    different whether it's A or B).
    Do you mean that a both front end requests, /myapp/A and /myapp/B, both
    request just /myapp/ on the back end server?

    I assume so because otherwise you have the pat to test.

    If so, that's similar to the problem with SSL where the front end
    server proxies the same path to the backend. How does the backend
    know to make a http or https url with uri_for()?

    What I do is have the Cat application listen on different ports so the
    Cat application knows if it was an ssl request based on the port the
    request comes in on.


    --
    Bill Moseley
    moseley@hank.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedFeb 9, '07 at 9:40a
activeFeb 9, '07 at 3:45p
posts3
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase