Author |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Tue 18 Aug '09 14:34 Post subject: Apache fronted two JBoss/Tomcat instances |
|
|
Hi
Since yestarday i'm facing with problems with Apache/Mod_jk and JBoss 4.2.3GA.
My apache (ip : 192.168.1.1) is fronted before JBoss/Tomcat ( ip 192.168.1.2) application server. Communication between Apache and JBoss/Tomcat has been based on Apache mod_jk module and connectors configuration in JBoss/Tomcat.
Now i set up another JBoss/Tomcat server (ip:192.168.1.3) and need to forward requests by same Apache instance - just one Apache fronted two JBosses.
JBosses don't work as cluster.
How to set up mod_jk module (couse i think this is main stuff to configure) to forward request to two Jbosses? Application names (aliases) are different in both JBosses.
Thanks in advance for help ! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Wed 19 Aug '09 13:01 Post subject: |
|
|
As i said my jbosses are not clustered and i don't expect load balance behavior from Apache.
Just want to cover them both by fronted Apache nothing more - f.x. if someone request www.mydomain.com/app1 apache will forward request to proper JBoss instance.
I hoped that with mod_jk 1.2.28 i would be able to move whole mod_jk configuration (currently located in mod_jk.conf and included to httpd.conf) to virtual host section and prepare different configuration for each vh.
Tried to set it up this way :
Code: | <VirtualHost 192.168.1.1:80>
<IfModule jk_module>
some mod_jk directives f.x.
JkWorkersFile path_to_file
</IfModule>
</VirtualHost> |
And i got error :
Code: | Syntax error on line 565 of C:/wamp/bin/apache/apache2.2.8/conf/httpd.conf:
JkWorkersFile cannot occur within <VirtualHost> section
|
Mod_jk updated to 1.2.28 - same problem. Any ideas ? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 19 Aug '09 15:30 Post subject: |
|
|
Second thing I can think of is a reverse proxy. I don't know a solution to send all requests to both JBOSS server.
Code: |
ProxyPass / balancer://mycluster stickysession=jsessionid nofailover=On
<Proxy balancer://mycluster>
BalancerMember http:// 192.168.1.2:8080
BalancerMember http:// 192.168.1.3:8080 smax=10
</Proxy>
|
|
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Thu 20 Aug '09 11:32 Post subject: |
|
|
Please take a look here :
http://www.apachelounge.com/viewtopic.php?t=2229
Quote: |
In an virtual host environmet, JkMount/JkUnMount/JkMountfile are not longer inherited between virtual hosts or from the global server.
So if you use virtual host, as i do, you have to define all relevant JkMount/JkUnMount/JkMountfile in the virtual host or if you still want to define them globally, use the "JkMountCopy On" inside the virtual host or , if you have sevral virtual hosts, add the "JkMountCopy all" to the global server.
|
What i'm trying to say is that user krka01 was able to define all mod_jk module directives inside virtual host and i'm not. The thing he's suggesting is that every virtual host could have its own mod_jk configuration different then others. But it doesn't work for me |
|
Back to top |
|