Following the prompts given by Nestor Urquiza, I was able to solve the problem by specifying an additional Host in tomcat server.xml, because, as said, tomcat responds to the j_security_check request with the forward command to the browser, which inevitably contains the context name so that users trying to log in into the system, get 408 errors. Therefore, the real end-to-end operation inside the Apache VirtualHost directive JkMount /* worker1 achievable by creating the intended context of a ROOT .
Apache httpd.conf [and / or included .conf] file:
<VirtualHost *:80> ServerName appWelcome.example.org ServerAlias www.appWelcome.example.org JKMount /* worker1 </VirtualHost> LoadModule jk_module modules/mod_jk.so JWorkersFile /etc/apache2/workers.properties JkShmFile /var/log/apache2/mod_jk.shm
Thus, in order to match the entire request made in the http://appWelcome.example.org/ subdomain directly in the tomcat in-charge / appWelcome context, the appWelcome context must be addressable with the request to http://appWelcome.example.org:8080/
So, the tomcat server.xml file will carry a separate Host for the application you want to expose :.
<Server ...> <Service> <Engine defaultHost="localhost" ...> <Host name="appWelcome.example.org" appBase="appWelcomeBase" ... > <Valve ... /> </Host> <Host name="localhost" appBase="webapps" ...> <Valve ... /> </Host> </Engine> </Service> </Server>
Note that permissions (and the selinux if enabled context) must be adjusted to simulate the default values โโof Host as follows:
$CATALINA_HOME/conf/Catalina/app.example.org as $CATALINA_HOME/conf/Catalina/localhost
$CATALINA_HOME/appWelcomeBase as $CATALINA_HOME/webapps
In this case, all that remains to be done is to rename the problem and move the web archive appWelcome.war for automatic deployment in the created appBase (replacing $ CATALINA_HOME with its value, for example / var / www / tomcat 7):
# mv $CATALINA_HOME/webapps/appWelcome.war $CATALINA_HOME/appWelcomeBase/ROOT.war
Voila!
simonarame
source share