Try this:
<virtualhost mydomaine.com:80>
ServerName mydomaine.com
ProxyRequests Off
ProxyPass /server_test ajp://internalIp:8008/
ProxyPass /server_prod ajp://internalIp:8009/
ProxyPassReverse /server_test ajp://internalIp:8008/
ProxyPassReverse /server_prod ajp://internalIp:8009/
</virtualhost>
However, you would not be able to use ProxyPassReverseCookiePath
, because both Tomcat sites would set cookies with /
as the path.
To make it work as I believe you want, you need to have two separate VirtualHost
s. If you only have one IP address, you need to use name-based virtual hosts.
For example, add a subdomain test.mydomaine.com
that has the same IP address as mydomaine.com
. Then use this configuration:
NameVirtualHost mydomaine.com:80
<virtualhost mydomaine.com:80>
ServerName mydomaine.com
ProxyRequests Off
ProxyPass / ajp://internalIp:8009/
ProxyPassReverse / ajp://internalIp:8009/
</virtualhost>
<virtualhost mydomaine.com:80>
ServerName test.mydomaine.com
ProxyRequests Off
ProxyPass / ajp://internalIp:8008/
ProxyPassReverse / ajp://internalIp:8008/
</virtualhost>
You can then access your production site at http://mydomaine.com/ and your test site at http://test.mydomaine.com/.