proxypass ajp with apache and tomcat for multiple websites

I have Website running on Tomcat on port 8080 with ProxyPass enabled.
Now I want to install WordPress on Apache say www.domain.com/blog.
I tried various combinations in Apache but without any luck.

I have following configuration in Apache which works fine for www.domain.com but for www.domain.com/blog what configurations I have to make so that www.domain.com works on Tomcat and www.domain.com/blog works on Apache.

<VirtualHost *:80>
   ServerName www.domain.com
   RewriteEngine On
   RewriteCond %{HTTPS} !on
   RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile 
    SSLCertificateKeyFile 
    SSLCertificateChainFile
    ProxyRequests On
    <Proxy *>
            AddDefaultCharset Off
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

Answer

Using the exclamation mark ! you can define an exclude before your existing ProxyPass rule to define a subdirectory that should not be forwarded:

   ProxyPass /blog !
   ProxyPass / ajp://...
   ProxyPassReverse / ajp://... 

Attribution
Source : Link , Question Author : niteshd22 , Answer Author : HBruijn

Leave a Comment