Linux Tomcat accessing files on the server

 
It took a long time for the IT novice to figure IT out, especially the first one, which he tried unsuccessfully for a long time, was to restart the Tomcat server
 
The first method is to modify the server.xml file in the conf directory
In & lt; Host> I’m going to add in the tag

< Context path=”/upload2″ reloadable=”true” docBase=”/test/t2″/>
Path is the path you type in the browser and DocBase is the actual path to your server folder
After the change, you need to cut back to the bin directory and restart Tomcat:
To shut down Tomcat./shutdown. Sh
Open the Tomcat./startup. Sh
 
FTP then forwards an image to the server’s /test/t2/ directory
In the browser through the URL access, preceded by the server public network IP or domain name

 
The second method: create a new configuration file in conf/Catalina/localhost (recommended)
In the/usr/local/tomcat/conf/Catalina/localhost (if the directory does not exist, create) to create a file ` upload. XML ‘
& lt; ?The XML version = “1.0” encoding = “utf-8”?>
< Context path=”/upload” reloadable=”true” docBase=”/home/admin”/>

br> N>
The fil>e and path values must be the same
This approach does not require a restart of the Tomcat server

Read More: