Creating a java web application as the root of a domain name in Tomcat 6

I am currently developing the Java myapp Java application and when deployed to a Tomcat 6 server, I get access to myapp with this URL: http://localhost:8080/myapp

Instead, I want to access my application using this URL: http://myapp:8080since myapp will be the only application deployed in my Tomcat 6.

How should I do it?

+3
source share
2 answers

This can be done in Tomcat in basically two ways:

  • Set the pathelement attribute <Context>to Webapp/META-INF/context.xml(or Tomcat/conf/server.xml, depending on where you want to define it) to an empty string. For instance.

    <Context path="">
    
  • ROOT.war, Tomcat ROOT.

Tomcat , () , URL .htaccess ..

+4

, , URL http://localhost:8080 not http://myapp:8080.

, tomcat, webapps (, , myapp), ROOT ( Tomcat 6). ROOT myapp ROOT. , , -- webapps, - ROOT.

tomcat/conf/, server.xml, server.xml, .

+2

Source: https://habr.com/ru/post/1730323/


All Articles