I used to configure HTTP Apache correctly to redirect incoming HTTP requests to port 80 to a Tomcat instance running on port 8080. However, now I am in a situation where I need to be able to proxy incoming requests to port 80 or Tomcat @ 8080, or another process @ 9000, depending on the host name. The following is a snippet of my attempt to configure my Apache configuration to handle this case:
<VirtualHost *:80> ServerName hostname1 ProxyPreserveHost On ProxyPass / http://hostname1:8080/ ProxyPassReverse / http://hostname1:8080/ </VirtualHost> <VirtualHost *:80> ServerName hostname2 ProxyPreserveHost On ProxyPass / http://hostname2:9000/ ProxyPassReverse / http://hostname2:9000/ </VirtualHost>
Now, when you request either host_name_1 or host_name2 , I get an instant 500, apparently due to the fact that mod_proxy does not find any suitable rules for proxying the request:
[Fri Feb 08 06:41:01 2013] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
Please note that Tomcat does not accept incoming requests and therefore does not display a log
For common sense, I checked that I can really access these two resources individually in their respective ports, that is, I can access hostname1 using hostname 1: 8080 and hostname2 using hostname2 :. 9000
Are there any flaws here to help me set this up correctly?
Also, are there more efficient ways to manage this, perhaps in a more reasonable way?
Thanks for the help!
jerluc
source share