I am using the following VirtualHost
and mod_proxy to proxy all requests for my 'api' subdomain to my Java webservice which is located at webapps/webservice
on my Tomcat.
<VirtualHost *:80>
ServerName api.mydoamin.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /webservice http://localhost:8080
ProxPassReverse / http://localhost:8080
</VirtualHost>
My problem is if I type 'api.mydomain.com' I get redirected to 'api.mydomain.com/webservice' and I get a 404 error because "webservicewebservice" is not available.
Does anybody know what to do?
Solution: Even though I've tried this solution before, Stony was right! The problem in my case was that, even if I hadn't changed anything there, I had to restart Tomcat to make it working. I restarted Apache multiple times but that didn't change anything.