How do you change the default directory in Tomcat?
To change the default directory of Tomcat, follow these steps:
- 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.
- 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.
- After making the changes, save the configuration file and restart the Tomcat server for the modifications to take effect.