I have three tomcat instances for three different applications. They are using 8080,8081,8082 ports in one machine. How can I change configurations so that users are able to access from 80 port with different host names? I have installed an Apache on my machine and tried to configure it with following tutorial: How to load balance Tomcat 5.5 with Apache on Windows until load balancing point starts. I have questions based on this tutorial. My web applications is under webapps/ROOT in all tomcat instances.
I have this configuration in httpd.conf:
<IfModule jk_module>
JkWorkersFile D:\containters\_tomcat_backend\conf\workers.properties
JkShmFile D:\containters\_tomcat_backend\logs\mod_jk.shm
JkLogFile D:\containters\_tomcat_backend\logs\mod_jk.log
JkLogLevel debug
JkMount / worker1
JkMount / worker2
</IfModule>
And I’m getting this warining when I run httpd.exe from command prompt:
[warn] NameVirtualHost *:80 has no VirtualHosts
Am I in correct way to make my applications work with 80 port? And how can I configure this warning?
For your scenario, you will not need load balancing. In your httpd.conf, you should define 3 virtual hosts for the host names you want to use (as described here). In each of the
VirtualHostdirectives, insert aJkMountfor a worker to be defined in your workers.properties like:Now comes the workers.properties:
N.B.: I use different ports than the ones you specified, because communication between Apache and Tomcat is runs via AJP. Finally, add a matching AJP connector in each of your tomcat’s server.xml:
See this for more details. The warning you mentioned seems to be caused by an incomplete virtual host configuration. Are there no
VirtualHostinstances defined yet?Edit: If you don’t like that much configuration, you could also use your Apache as a proxy and distribute traffic to your tomcats via the
ProxyPass/ProxyPassReversedirectives.