I have a question about proxy and ajp module.

On my machine I have a Apache web server and a Tomcat servlet container.

On Tomcat is running a my java webapplication.

On Apache I have some services and I can call these in this way:


I would configurate a ajp connector to call my tomcat webapplication from Apache. I would somethin as http://myhost to call the Tomcat webapp.

So, I configurated my apache in this way..and I have what I wanted: I can use http://myHost to visualize the Tomcat webApp by Apache.

<VirtualHost *:80>

    ProxyRequests off
    ProxyPreserveHost On

    ServerAlias myserveralias
    ErrorLog logs/error.log
    CustomLog logs/access.log common

    <Proxy *>
      Order deny,allow
      Allow from all

     ProxyPass /server-status !
     ProxyPass /balancer-manager !

    ProxyPass / balancer://mycluster/ stickysession=JSESSIONID nofailover=Off maxattempts=1

    <Proxy balancer://mycluster>
       BalancerMember ajp://myIp:8009  min=10 max=100 route=portale loadfactor=1
       ProxySet lbmethod=bytraffic

    <Location /balancer-manager>
        SetHandler balancer-manager
        Order deny,allow
        Allow from localhost

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent


But, now I can't use the apache services:

If I use http://myhos/service1 I have an error because apache try to search service1 on my tomcatWebApp.

Is there a way to fix it?


You can prevent your Apache services from being proxied to Tomcat by using the ! exclusion syntax, just like you're already doing for server-status and balancer-manager:

ProxyPass /service1 !
ProxyPass /service2 !
ProxyPass /service3 !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.