Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3361666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:10:49+00:00 2026-05-18T03:10:49+00:00

I’m trying to get a basic Apache 2.2 load balancer running on top of

  • 0

I’m trying to get a basic Apache 2.2 load balancer running on top of two Tomcat 6 installations. I’m reading through all the documentation and I’m having trouble getting it working correctly. I’m fairly certain I have the Apache configuration correct, but I think I’m missing something in my Tomcat settings that’s preventing a connection. The Tomcat Connector documentation is good for how to modify Apache, but doesn’t mention what needs to change in the Tomcat settings.

Here’s my basic set up. All 3 installs are on the same machine (this is just a test setup). So, Apache 2.2 installed in C:\apache directory. Listens on port 80. 2 Tomcat 6 installs, one listens on port 81, one on port 82. The Apache will simply route everything to the Tomcat servers, acting as a 100% load balancer.

Here’s the errors I’m getting in my mod_jk.log file when I try to get a connection at http://localhost:80/index.jsp . It’s a 502 Bad Gateway error.

[Mon Nov 15 13:05:04.681 2010] [3596:1496] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (1245): wrong message format 0x4854 from 127.0.0.1:81
[Mon Nov 15 13:05:04.681 2010] [3596:1496] [error] ajp_get_reply::jk_ajp_common.c (2058): (tomcat1) Tomcat is down or refused connection. No response has been sent to the client (yet)
[Mon Nov 15 13:05:04.681 2010] [3596:1496] [info] ajp_service::jk_ajp_common.c (2543): (tomcat1) sending request to tomcat failed (recoverable), because of protocol error (attempt=1)

Here is the settings I have in my Apache’s httpd.conf file…

LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
    JkWorkersFile conf/workers.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel info
    JkMountFile conf/uriworkermap.properties
</IfModule>

Here is the workers.properties file I have…

#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#
worker.list=loadbalancer,jkstatus

#
# Define the servers in our cluster
#
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=81
worker.tomcat1.lbfactor=2

worker.tomcat2.type=ajp13
worker.tomcat2.host=localhost
worker.tomcat2.port=82
worker.tomcat2.lbfactor=1

#
# Defining a load balancer
#
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=tomcat1,tomcat2
worker.loadbalancer.sticky_session=false

#
# Define status worker
#
worker.jkstatus.type=status

Here is the uriworkermap.properties I have

#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]

/*.*=loadbalancer

Finally, here’s the Tomcat’s Engine tag in its server.xml file

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />

      <Host name="localhost" appBase="webapps" deployOnStartup="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="localhost_access_log." suffix=".txt"
                 pattern="common" resolveHosts="false"/>
      </Host>

    </Engine>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:10:50+00:00Added an answer on May 18, 2026 at 3:10 am

    Found the correct answer after some additional digging. I needed to create an AJP connector in each Tomcat’s server.xml file. The Apache’s mod_jk connects to this port, and then Tomcat relays that port to the HTTP Connector port.

    <Connector port="8009" protocol="AJP/1.3" redirectPort="81" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.