How do you change the default directory in Tomcat?

To change the default directory of Tomcat, follow these steps:

  1. Open the configuration file for Tomcat, usually located in the conf folder within the Tomcat installation directory, where you can find the server.xml file.
  2. Locate the following configuration option to modify the default directory of Tomcat:
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

Here, the appBase=”webapps” specifies that the default directory for Tomcat is webapps, and you can change it to any directory of your choice.

  1. After making the changes, save the configuration file and restart the Tomcat server for the modifications to take effect.
Leave a Reply 0

Your email address will not be published. Required fields are marked *