How do I setup Artifactory to run as the “ROOT” application in Tomcat?

Following each of the methods has to be done while Artifactory is not running.
 

Method #1 - Renaming the artifactory.war

1. Rename the $ARTIFACTORY_HOME/webapps/artifactory.war to "ROOT.war"
2. Rename $ARTIFACTORY_HOME/tomcat/conf/Catalina/localhost/artifactory.xml to "ROOT.xml"
3. Edit the "ROOT.xml" file, change the context path to "/" and docBase to "${artifactory.home}/webapps/ROOT.war"
4. Remove the $ARTIFACTORY_HOME/tomcat/work/Catalina/ directory if this exists
5. Remove the $ARTIFACTORY_HOME/tomcat/webapps/ROOT/ and $ARTIFACTORY_HOME/tomcat/webapps/artifactory/ directories if those exist

 

When upgrading, the above steps have to be performed following the upgrade.

 

Method #2 - Editing the server.xml

1. Remove the $ARTIFACTORY_HOME/tomcat/conf/Catalina/localhost/artifactory.xml
2. Remove the $ARTIFACTORY_HOME/tomcat/webapps/ROOT/ and $ARTIFACTORY_HOME/tomcat/webapps/artifactory/ directories if those exist
3. Edit the $ARTIFACTORY_HOME/tomcat/conf/server.xml file as follows:
 
For Artifactory versions below 5.4:
<Server port="8015" shutdown="SHUTDOWN">
   <Service name="Catalina">
       <Connector port="8081"/>
       <Engine name="Catalina" defaultHost="localhost">
           <Host name="localhost" appBase="webapps">
             <Context path="" docBase="${artifactory.home}/webapps/artifactory.war" processTlds="false">
               <Manager pathname="" />
              </Context>
           </Host>
       </Engine>
   </Service>
</Server>

 

For Artifactory versions 5.4 and above
<Server port="8015" shutdown="SHUTDOWN">
   <Service name="Catalina">
       <Connector port="8081"/>
       <Engine name="Catalina" defaultHost="localhost">
           <Host name="localhost" appBase="webapps" startStopThreads="2">
             <Context path="" docBase="${artifactory.home}/webapps/artifactory.war" processTlds="false">
              <Manager pathname="" />
             </Context>
           </Host>
       </Engine>
   </Service>
</Server>

 

When Upgrading:
1. Backup the server.xml and restore it to the new "tomcat" directory as mentioned in the upgrade instructions.
2. Remove the $ARTIFACTORY_HOME/tomcat/conf/Catalina/localhost/artifactory.xml.
3. Remove the $ARTIFACTORY_HOME/tomcat/webapps/ROOT/ and $ARTIFACTORY_HOME/tomcat/webapps/artifactory/ directories if those exist