top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Session synchronization between two httpd servers

+1 vote
520 views

I would like to know, if there exists any solution in order to synchronize (replicate) sessions between two httpd servers which are configured as load balancers using mod_proxy_balancer? Considering HAProxy, the same functionality exists; it is possible to synchronize the stick table between HAProxy instances. Does mod_proxy_balancer use stick table? Is it possible to synchronize the stick table between two mod_proxy_balancer instances?

posted Sep 10, 2013 by Deepak Dasgupta

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Store the session information in a cookie as explained in the mod_proxy_balancer documentation. In that way the client will provide the session info to apache, no matter which one it lands on (assuming both of them are configured identically). This implies usage of sticky sessions. As far as Im aware this is the way HAProxy does it as well. Can you please elaborate on which HAProxy (different) functionality you are talking about in regards of sticky table synchronization?

answer Sep 11, 2013 by Dewang Chaudhary
You are talking about peers option in HAP. I am afraid there isn't option like that in apache.
Similar Questions
+2 votes

I am asking best practice/info/docs of how to have 2 apache web servers in load balancing.
- Which httpd module do I have to load in the http conf?
- I was reading that I have to have a web load balancer on top of them? Is it necessary? Can they accept requests from a cisco /F5 load balancer?
- What about persistent connection?
- Also we''ll have a mySQL server? Any more info about this?

0 votes

In my apache configuration, I am using a scripting language (tcl through apache rivet) which implements a "heavy" application, something that takes some minutes to start when apache starts a new process.

Is there a way to "separate" these "heavy" apache processes from the rest of the apache?

I.e. when the url is "/my_heavy_service" redirect the request to the apache which has the "heavy" application loaded, and the rest of the requests be handled by an apache with does not even has mod_rivet loaded?

Like starting an apache on a different port (i.e. 8123), which loads my application, and starting a "normal" apache on port 80, which serves all requests except some, which are directed to the server in port 8123.

In general I think it can be done (i.e.: http://wiki.apache.org/httpd/RunningMultipleApacheInstances),
but is a way to do this in fedora 19, and keep all this "systemctl * httpd" stuff?

Has anyone attempted this?

0 votes

My System : CentOS Linux release 7.2.1511 (Core)
My Apache version : Apache/2.4.6 (CentOS)

I have configured two httpd instance.

I'm looking for a way to use "apachectl fullstatus" command for the second instance. Is this possible?

0 votes

I am a bit confused about the mod_rewrite documentation. It shows this rule to block hotlinking:

RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

however, I'd think a better rule would be:

RewriteCond "%{HTTP_REFERER}" "^$" [OR]
RewriteCond "%{HTTP_REFERER}" "!(www.)?example.com/.*$" [OR,NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

if I want to block anyone manually typing in a link (no referer) + hotlinking (probably has a referer). Do i need the [OR] on the 1st
RewriteCond and not the 2nd one? It seems to work with OR on both conditions.

...