How to remove application name in URL? tomcat + httpd

everything

I created the Apache Click Framework web application and just threw it into tomcat for httpd.

(Suppose my domain name is www.domain.com.) Therefore, I can access my application at the URL: www.myDomain.com/myApp/pages/login.htm

My questions are: how do I remove the “myApp” part in this configuration URL in httpd or tomcat? because my domain name already has words like "myApp".

+4
source share
2 answers

Just name your military file root.war and deploy it to tomcat. You probably need to delete the pre-configured ROOT/ directory in tomcat first, if it exists.

+2
source

You need to do a URL redraw that supports most frames, such as struts, spring mvc, which you can configure in your web.xml in the case of a java web application

Please check if you can do with tomcat server.xml below (but I'm not sure about this, rewriting URLs will solve your problem)

Contact: http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html .

etc / hosts to add something like below

127.0.0.1 mydomain.com

Changes to the .xml server

 <Host name="bbstats.localhost" appBase="webapps/myapp" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host> <Context path="/myapp" docBase="bbstats" debug="5" reloadable="true" crossContext="true"> </Context> 
+2
source

All Articles