I am trying to configure my (internal) test server to run 2 tomcat applications (actually 2 versions of the same one side by side). We are using Apache2.4 with mod_jk & Tomcat8. At the moment I am trying to work downwards and so the first step I am trying is to get the current (embedded) tomcat application to continue to run properly on port 80 and to initially fail to run a non existent application on port 81.
So currently it works with one application on
http://LOCALSERVERNAME
My changes have it working (same app) on
1) http://LOCALSERVERNAME
and
2) http://LOCALSERVERNAME:81
but I want it to continue to work as is for 1 and run a different application for 2.
So I've modified the httpd.conf to listen on both ports
Listen 80
Listen 81
With the existing jkMount setting this
JkMount /* worker1
JkMount /localhost:80 worker1
JkMount /localhost:80/* worker1
JkMount /127.0.0.1:80 worker1
JkMount /127.0.0.1:80/* worker1
opens the tomcat app on both ports (and not on other ports) so the listener directives are working. I think this is just using JkMount /* worker1 however.
I modified this in the interim by commenting that out and trying both the options below (separately)
#JkMount /* worker1
#JkMount /*:80/* worker1
JkMount /194.66.181.17:80/* worker1
I have set the servername entry to the local server name
ServerName LOCALSERVERNAME
this is giving me an authentication required logon popup & 401 error despite there being no password protection on the apache server. I'm assuming this is an error in the config.
I have modified the worker.properties from the one I inherited and on browsing for a solution I think I may have misunderstood it's purpose. It was using a balancer (with the same issies as noted) and I modified it thinking I would be using it to feed the tomcat apps with different ports (8009 & 8011). I have seen someone saying that the worker.properties file is only really for using as a load balancer so maybe this was a mistake ?
worker.list=worker1, worker2
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker2.port=8011
worker.worker2.host=localhost
worker.worker2.type=ajp13
My httpd-vhosts.conf file looks like this although I have tried lots of things in the 2nd entry and I don't think they are ever picked up - I think the closest I have had it to working has been when both ports 80 & 81 have run to the (same) existing app and has probably just used the first entry.
<VirtualHost [IP-address]:80 localhost:80>
servername LOCALSERVERNAME
DocumentRoot "E:/Production/Apache/htdocs"
<Directory "E:/Production/Apache/htdocs">
Options +FollowSymLinks
AllowOverride All
</Directory>
JkOptions +ForwardURICompatUnparsed
ProxyRequests off
JkMount /* worker1
</VirtualHost>
<VirtualHost [IP-address]:81>
servername LOCALSERVERNAME
DocumentRoot "E:/Production/Apache/dummy"
</VirtualHost>
So... my question is can I use apache on my local domain server to run 2 embedded tomcat applications using mod_jk ? If so can anyone point out where my config has gone wrong ? I'm assuming I'm going in the wrong direction somewhere rather than needing a minor tweak ?