Link to home
Start Free TrialLog in
Avatar of aloknet21
aloknet21Flag for India

asked on

Web pages did not sync with Mod_jk loadbalancer configured with Apache and Jboss in Linux server

Hi,

I have a website that is configured on Jboss on Two Linux instances. Apache Mod_jk is working as a load balance with jboss.

We have a problem with the login process.
•      I went to Firefox and clicked Sign In Here and log in with my credentials at 7:27:20.
•      35 seconds later (7:27:55), the login process appears to have completed; however, the site still says Sign In Here:
o       
•      So I clicked refresh pages and then Account Administration and the site still said Sign In Here.
•      Thinking that the site did not log me in I tried again (47 seconds).
•      The site next took me to the Account Administration page and now said Welcome test user:
o       
•      I logged out and the site properly said Sign In Here. Then I clicked For refresh page and the site said “Welcome test user” but I logged out so why does this happen?

I tried another browser, Chrome:
•      I signed in and it took 38 seconds. This time it properly says Welcome test user
•      I went to For refresh page and was still logged in so I logged out again and the site properly says Sign In Here.
•      Then I clicked Sign In Here and the login page says Welcome test user and has the blank fields for login. This should be impossible:

•      I tried logging in as another user and the site says incorrectly says Sign In Here. I clicked For refresh pages and it said Welcome [with the user’s name], making it look like I am logged in.
•      Then I clicked Account Administration and I am brought to the Sign In page as if I am not logged in.
•      Now I try logging in repeatedly and it keeps asking me to Sign In.
The login is definitely not working right. It says Welcome [Your Name] when you are logged out and Sign In here when you are logged in.

What i did to verify jboss functionality is:

i stopped jboss service from instance A. it works perfectly.

i started jboss service from instance A and stopped jboss service from instance B. it works perfectly.

So i believe Mod_jk load balancer is misbehaving.

Please suggest.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aloknet21

ASKER

I have implemented loadbalance through Mod_jk

Here is worker.properties configuration.


# Define list of workers that will be used
# for mapping requests
# The configuration directives are valid
# for the mod_jk version 1.2.18 and later
#worker.list=loadbalancer,status
#worker.list=node2
worker.list=loadbalancer,status,node2,node1
######START Current Relaese Nodes##########

# Define Node2 Web Live
worker.node2.port=8010
worker.node2.host=192.168.90.6
worker.node2.type=ajp13
worker.node2.lbfactor=1
#worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
#worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
#worker.node2.ping_mode=A #As of mod_jk 1.2.27

# Define Node2 Web Live
worker.node1.port=8010
worker.node1.host=192.168.90.7
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
#worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
#worker.node1.ping_mode=A #As of mod_jk 1.2.27

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node2,node1
#worker.loadbalancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status

Here is the configuration of apache for the website

:

<VirtualHost 192.168.90.6:80>
        ServerName www.testprotocols.com
        ServerAlias testprotocols.com
        CustomLog logs/access_log combined

        JkMount /cdp/view/AbouttestProtocolsMobileWebsite.html node2
        JkMount /* loadbalancer

#ProxyRequests           Off
#   ProxyPreserveHost       On
#RewriteEngine           On

        <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REMOTE_ADDR} (.*)
        RewriteRule .* - [E=R_A:%1]
        RequestHeader add TEST_SRC_ADDR %{R_A}e
RewriteCond %{HTTP_HOST} !^www\.testprotocols\.com [NC]
RewriteRule ^(.*)$ http://www.testprotocols.com$1 [L,R=301]

</IfModule>

Here is Mod-jk Configuration details

:

# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile conf/workers.properties
#JkWorkersFile conf/workers1.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"

JkShmFile logs/jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
</Location>

</VirtualHost>

Please suggest, where i am missing the point.

Thanks for your help.