Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

http://myhos/service1
http://myhos/service2
http://myhos/service3

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
    </Proxy>

     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
    </Proxy>

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


    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

</VirtualHost>

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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 !
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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