There are two most common ways to configure virtual paths in tomcat:

The first one: For example, put the mysite folder in webapps into the friut folder under the H disk;

First: find <Host></Host> in conf/server.xml and add it in the tag

<Context path="/app" docBase="H:\\Friut\\mysite" reloadable="true" />

where app is the name, docBase is the path, and reloadable is set to true;

Restart the server when accessing, then http://localhost:8080/app/index.html //finally is the file name;

The second: create a myapp.xml in localhost under Catlina;

Then open the editor <?xml version="1.0" encoding="UTF-8"?>

<Context docBase="H:\\Friut\\mysite" reloadable="true" />

//There is no alias above, so when visiting, http://localhost:8080/myapp/index.html



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324857023&siteId=291194637