apache - Best way to have tomcat app reside at / -
at work have many spring apps running on 1 tomcat server. of apps have own domains virtualhost in apache rewrites requests /url /context_root/url.
this fine , except when use of springs tag libs handle urls. example <form:form> tag creates action of /context_root/form , takes user away /. now, app still works when happens management doesn't want see context root.
what best way tackle this?
in case stumbles this, did end finding answer.
with tomcat can have multiple hosts. setup host app default webapp. here's example:
add host server.xml
<host name="lilhug.mydomain.com" appbase="lilhug" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false"/> create files , directories
mkdir $catalina_home/lilhug mkdir $catalina_home/conf/catalina/lilhug.mydomain.com if want tomcat manager host
cd $catalina_home/conf/catalina cp localhost/manager.xml lilhug.mydomain.com then restart tomcat , you're good. deploy lilhug app / using /manager running @ new host or copy war $catalina_home/lilhug/root.war
Comments
Post a Comment