[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to use Apache HTTP Server as LoadBalancer with CaptainCasa?  XML
Forum Index -> Deployment
Author Message
mmueller

Active

Joined: 17/12/2009 07:05:17
Messages: 24
Location: Ettlingen
Offline

First I tried the first sample of http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html
But this did not work:
The requests of a single client were routed alternately to the two tomcats behind the HTTP server.
It seems that Cookies are not supported by CaptainCasa (neither by jnlp nor by applet clients).
Therefore the web server had no chance to route the requests to their already running sessions.

  • Is there a chance to activate cookie handling in CaptainCasa?
  • Is there a chance to balance HTTP requests as shown by the example above?
  • If AJP is required to get CaptainCasa working, is it also required to separate static and dynamic content?
  • Should I use mod_proxy or mod_jk?
  • Is there a description of all steps needed to get CaptainCasa applications working with mod_proxy or mod_jk?

    Kind regards,
    MaMue
  • [WWW]
    CaptainCasa

    Power User
    [Avatar]

    Joined: 21/11/2007 12:23:06
    Messages: 5555
    Offline

    Hi,

    there are two issues:

    1. CaptainCasa (or I better say: the applications built with CaptainCasa) are by default session-sticky - if they do not explicitly pay attention to session serialization issues.
    2. CaptainCasa exchanges session-ids by URL-encoding - not by Cookies. Reason: there is only one session cookie per browser instance - if a browser opens up multiple windows, then session management by cookies in general brings up severe problems. In general: session-id-management via URL-encoding is the much cleaner way than using cookies.

    URL-encoding means that each request (that is session related) includes something like ";jsessionid=..." in its URL. You need to configure the dispatcher accordingly.

    I just found the sentence "The module mod_proxy_balancer implements stickyness on top of two alternative means: cookies and URL encoding" in the link you sent. So URL-encoding is the way to go. There are no other special things to consider here, all this is web-standards...

    Regards, Björn



    Björn Müller, CaptainCasa GmbH
    mmueller

    Active

    Joined: 17/12/2009 07:05:17
    Messages: 24
    Location: Ettlingen
    Offline

    Hi Björn,

    thank you for your helpful hints.

    Apache Web Server is now running as load balancer on my box.

    Basically I added in httpd.conf the following lines:

    Code:
     LoadModule  proxy_module           modules/mod_proxy.so
     LoadModule  proxy_balancer_module  modules/mod_proxy_balancer.so
     LoadModule  proxy_http_module      modules/mod_proxy_http.so
             
     ProxyPass  /act3_explorer  <a href="balancer://credManCluster" target="_blank" rel="nofollow">balancer://credManCluster</a>  nofailover=On  stickysession=jsessionid
             
     <Proxy  <a href="balancer://credManCluster>" target="_blank" rel="nofollow">balancer://credManCluster></a>
         BalancerMember  <a href="http://host1/act3_explorer" target="_blank" rel="nofollow">http://host1/act3_explorer</a>  route=tc1
         BalancerMember  <a href="http://host2/act3_explorer" target="_blank" rel="nofollow">http://host2/act3_explorer</a>  route=tc2
         BalancerMember  <a href="http://host3/act3_explorer" target="_blank" rel="nofollow">http://host3/act3_explorer</a>  route=tc3
     </Proxy>
     


    In the server.xml files of the three tomcats on host1..3 I had to add
    - the attributes proxyName and proxyPort to the Connector element and
    - the attribute jvmRoute to the Engine element.

    Now it is time to separate static and dynamic content.

    Is there any documentation about it?
    Which files are needed on the tomcats, which may be moved to the web server,
    which patterns can I use to separate the processing of static and dynamic content in httpd.conf?

    Kind regards,
    MaMue
    [WWW]
     
    Forum Index -> Deployment
    Go to:   
    Powered by JForum 2.1.6 © JForum Team