logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Mod_balancer and Stickyness Question
Author
ocrgeek



Joined: 05 Oct 2014
Posts: 3

PostPosted: Sun 05 Oct '14 21:07    Post subject: Mod_balancer and Stickyness Question Reply with quote

Hi,

I tried to set up a little cluster using mod balancer. To implement stickyness I used the following setup:

Code:
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

<Proxy balancer://mycluster>
                # WebHead1
                BalancerMember http://host1:80/ route=1 loadfactor=4
                # WebHead2
                BalancerMember http://host:80 route=2 loadfactor=6

               # Security "technically we aren't blocking
                # anyone but this the place to make those
                # chages
                Order Deny,Allow
                Deny from none
                Allow from all

                # Load Balancer Settings
                # We will be configuring a simple Round
                # Robin style load balancer.  This means
                # that all webheads take an equal share of
                # of the load.
                ProxyPreserveHost On
                ProxySet lbmethod=bybusyness
                #ProxySet lbmethod=byrequests
                ProxySet stickysession=ROUTEID
      </Proxy>

That works fine so far. However, I could not find how I can set the timout for such sticky sessions. I would need a really long timeout for the stickyness since the users might come back later to download a file which is stored at a particular server. Is there a way to implement this? The site I use this for is the following one: https://www.ocrgeek.com/. Any help is appreciated... Thanks a lot!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 06 Oct '14 11:48    Post subject: Reply with quote

The timeout for the cookie can be set in the Header add Set-Cookie directive.

See http://en.wikipedia.org/wiki/HTTP_cookie#Expires_and_Max-Age
Back to top
ocrgeek



Joined: 05 Oct 2014
Posts: 3

PostPosted: Tue 07 Oct '14 18:39    Post subject: Reply with quote

Thanks a lot! That is what I was looking for Smile
Back to top


Reply to topic   Topic: Mod_balancer and Stickyness Question View previous topic :: View next topic
Post new topic   Forum Index -> Apache