How to change the ROOT application?

后端 未结 13 1469
终归单人心
终归单人心 2020-11-22 16:16

I\'m trying to change the default application of a Tomcat 6 webserver to a different application than \"ROOT\" (inside webapps folder). What is the best way to do this?

13条回答
  •  执笔经年
    2020-11-22 16:33

    Ultimate way to change tomcat root application. Tested on Tomcat 7 and 8.

    1. Move to the tomcat webapps directory:

      Example on my machine: ~/stack/apache-tomcat/webapps

    2. Rename, replace or delete ROOT folder. My advice is renaming or create a copy for backup. Example rename ROOT to RENAMED_ROOT:

      mv ROOT RENAMED_ROOT

    3. Move war file with your application to tomcat webapps directory (its a directory where was old ROOT folder, on my machine: ~/stack/apache-tomcat/webapps)

    War file must have a name ROOT.war. Rename your aplication if it's need: yourApplicationName.war -> ROOT.war

    1. Restart tomcat. After restart your application will be a root.

提交回复
热议问题