java - deploy war file on Tomcat and run without project name -
this question has answer here:
i 've created war file of web project (jsp/servlets).
project name: testapp
when deply in tomcat 7, run itlike that:
localhost:8080/testapp/ or www.maypage.com/testapp/
ok, works, need run without project name, that:
localhost:8080 , on hosting www.maypage.com
how can that? thank you.
and i'm fining jsp/servlet hosting, have configuration option. know hosting that?
in order access application without using application name, need deploy root application. there multiple ways achieve , related answer describes pretty well.
setting default application in tomcat 7
content copied above link:
first method:
first shutdown tomcat [from bin directory (sh shutdown.sh)] must delete content of tomcat webapps folder (rm -fr *) rename war file root.war start tomcat [from bin directory (sh startup.sh)]
second method:
leave war file in catalina_base/webapps, under original name - turn off autodeploy , deployonstartup in host element in server.xml file. explicitly define application contexts in server.xml, specifying both path , docbase. must this, because have disabled tomcat auto-deploy mechanisms, , tomcat not deploy applications anymore unless finds context in server.xml.
note:
that last method implies in order make change application, have stop , restart tomcat.
third method:
place war file outside of catalina_base/webapps (it must outside prevent double deployment). - place context file named root.xml in catalina_base/conf//. single element in context file must have docbase attribute pointing location of war file. path element should not set - derived name of .xml file, in case root.xml. see context container above details.
Comments
Post a Comment