logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache fronted two JBoss/Tomcat instances
Author
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 18 Aug '09 14:34    Post subject: Apache fronted two JBoss/Tomcat instances Reply with quote

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: 7306
Location: Germany, Next to Hamburg

PostPosted: Tue 18 Aug '09 16:55    Post subject: Reply with quote

Please read http://www.apachelounge.com/viewtopic.php?p=675

if you still have a question please ask again!
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Wed 19 Aug '09 13:01    Post subject: Reply with quote

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: 7306
Location: Germany, Next to Hamburg

PostPosted: Wed 19 Aug '09 15:30    Post subject: Reply with quote

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

PostPosted: Thu 20 Aug '09 11:32    Post subject: Reply with quote

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 Sad
Back to top


Reply to topic   Topic: Apache fronted two JBoss/Tomcat instances View previous topic :: View next topic
Post new topic   Forum Index -> Apache