You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amol Puglia <am...@yahoo.com> on 2010/09/13 11:35:05 UTC

[users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Hello Team,

I am trying to achieve load balancing with proxies modules.

Following are the configuration of proxy module.

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

<IfDefine SSL>
   Listen server_name:443

   <VirtualHost _default_:443>

      <Proxy balancer://tomcatservers>
         BalancerMember ajp://server_name:8009 route=tomcat4 retry=60
         BalancerMember ajp://server_name:8010 route=tomcat5 retry=60
      </Proxy>

      <Location /*>
         Allow From All
         ProxyPass balancer://tomcatservers/* stickysession=JSESSIONID nofailover=off
      </Location>


and tomcat server.xml contain following entry.

Tomcat5

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

Tomcat4

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


kindly assist me to acheive loadbalancing using proxies modules.



      

Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
> <Location /*>
>    Allow From All
>    ProxyPass balancer://tomcatservers/* stickysession=JSESSIONID
> nofailover=off
> </Location>

Don't use the wildcards:

<Location />
    Allow From All
    ProxyPass balancer://tomcatservers stickysession=JSESSIONID
nofailover=off
</Location>

Or use the simpler

ProxyPass / balancer://tomcatservers stickysession=JSESSIONID nofailover=off

Joost

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Posted by Amol Puglia <am...@yahoo.com>.
Hello Eric,

I have tested my virtual host configuration using command apachectl -S and it's saying syntax OK.

bash-3.00# ./apachectl -S
VirtualHost configuration:
Syntax OK
bash-3.00#

I have added same proxy configuration outside virtual host and it is not working there as well.

kindly guide and let me know if i am missiong anything in the configuration.

<Proxy balancer://tomcatservers>
   BalancerMember ajp://server_name:8009 route=tomcat4 retry=60
   BalancerMember ajp://server_name:8010 route=tomcat5 retry=60
</Proxy>

<Location /*>
   Allow From All
   ProxyPass balancer://tomcatservers/* stickysession=JSESSIONID nofailover=off
</Location>

--- On Mon, 9/13/10, Eric Covener <co...@gmail.com> wrote:

From: Eric Covener <co...@gmail.com>
Subject: Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working
To: users@httpd.apache.org
Date: Monday, September 13, 2010, 8:13 PM

On Mon, Sep 13, 2010 at 7:30 AM, Amol Puglia <am...@yahoo.com> wrote:
>
> Hello Eric,
>
> Thanks for the response.
>
> I have now mentioned the different route.
>
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">
> > <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat4">
>
> My problem is i am trying to acheive load balancing with mod_proxy module.
>
> When i am trying to access http URL,it's not gettign redirected to tomcat servers and just giving apache home page.
>
>  and
>
> When i am trying to access https URL,i am getting error page is not loading.
>
> kindly help me to find out why apache is not redirecting request to tomcat.


Your request probably isn't hitting the virtual host that you setup
the proxy directives in.  Maybe the ifDefine is confusing things, or
maybe your apachectl -S says you have dead vhosts, maybe your not
testing with SSL on the frontend...

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




      

Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Posted by Eric Covener <co...@gmail.com>.
On Mon, Sep 13, 2010 at 7:30 AM, Amol Puglia <am...@yahoo.com> wrote:
>
> Hello Eric,
>
> Thanks for the response.
>
> I have now mentioned the different route.
>
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">
> > <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat4">
>
> My problem is i am trying to acheive load balancing with mod_proxy module.
>
> When i am trying to access http URL,it's not gettign redirected to tomcat servers and just giving apache home page.
>
>  and
>
> When i am trying to access https URL,i am getting error page is not loading.
>
> kindly help me to find out why apache is not redirecting request to tomcat.


Your request probably isn't hitting the virtual host that you setup
the proxy directives in.  Maybe the ifDefine is confusing things, or
maybe your apachectl -S says you have dead vhosts, maybe your not
testing with SSL on the frontend...

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Posted by Amol Puglia <am...@yahoo.com>.
Hello Eric,

Thanks for the response.

I have now mentioned the different route.

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat4">

My problem is i am trying to acheive load balancing with mod_proxy module.

When i am trying to access http URL,it's not gettign redirected to tomcat servers and just giving apache home page.

 and

When i am trying to access https URL,i am getting error page is not loading.

kindly help me to find out why apache is not redirecting request to tomcat.

I have only noticed following error in the logs.

[Mon Sep 13 10:43:59 2010] [error] [client 172.17.136.151] File does not exist: /opt/web/apache2/htdocs/eMatrix
[Mon Sep 13 10:46:05 2010] [error] [client 172.17.136.151] File does not exist: /opt/web/apache2/htdocs/eMatrix
[Mon Sep 13 10:54:14 2010] [error] [client 172.17.136.151] File does not exist: /opt/web/apache2/htdocs/eMatrix



--- On Mon, 9/13/10, Eric Covener <co...@gmail.com> wrote:

From: Eric Covener <co...@gmail.com>
Subject: Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working
To: users@httpd.apache.org
Date: Monday, September 13, 2010, 4:43 PM

On Mon, Sep 13, 2010 at 5:35 AM, Amol Puglia <am...@yahoo.com> wrote:
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">

shouldn't the routes differ?  You never actually mentioned how your
server "doesn't work".

--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




      

Re: [users@httpd] Apache Tomcat Load Balancing with mod_proxy not working

Posted by Eric Covener <co...@gmail.com>.
On Mon, Sep 13, 2010 at 5:35 AM, Amol Puglia <am...@yahoo.com> wrote:
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">
> <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat5">

shouldn't the routes differ?  You never actually mentioned how your
server "doesn't work".

--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org