• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache + Tomcat - Mod_JK using Loadbalancer to setup clustering

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read a lot of documentation, I've spent many hours studying this, but I can't even do the basic: when I go to localhost/examples apache should redirect to localhost:8080/examples but that simply not working.

I'm using Ubuntu 10.10, Apache 2.2, Tomcat 6 and the Mod_JK connector 1.2.31 httpd 2.2 version http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.31/i386/[^]

In my /etc/apache2/apache2.conf I have


LoadModule jk_module mods-enabled/mod_jk.so
JkWorkersFile workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /examples worker1
JkMount /examples/* worker1
JkMount /servlets-examples ajp13
JkMount /examples/servlets/* ajp13



and then on my workers.properties (i'm keeping just for one worker just to make sure I solve my problem)

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300



and then of course, in server.xml I uncommented

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />



(what is the 8443 port? I tried 80 and 8080 but dont work too)

I place the distributed tag at web.xml.

So I did this by the book but it's not working. My problem is, when I go localhost/examples page is "not found". It should be found as I place localhost:8080/examples, but Apache it's not doing his job for some reason.

Anyone can please help? I get no errors and empty logs, so I have not a clue about what's happening.

EDIT: A very strange this is, if I place workers.properties on conf.d/ I get on of those errors invalid command 'worker.list=worker1', perhaps misspelled or defined by a module not included in the server configuration. Yes I updated the location on apache2.conf. I dont know if it's related.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Ubuntu, it's not a bad idea to create a separate conf file for things like your connector definitions. That way they can be switched on and off by moving them from the deployed apps directory to the undeployed apps directory and back. Plus it keeps the main conf file from getting big and confusing as you manage more and more products.

Port 8443 is the SSL traffic port corresponding to Apache's port 443. Port 8009 is the AJP connector, and the directive you referenced is merely telling Tomcat to look for encrypted traffic on 8443.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic