After installing Tomcat, the default is the home page of Tomcat, how to point the home page "http://127.0.0.1:8080" to our home page? This will set up Tomcat's virtual directory.
In the previous version of Tomcat, such as "Tomcat> conf", expand "Tomcat> conf", you can see a "server.xml" file, open it with the notepad, in the last part of the document There is an annotated "
Now let's specify the configuration of the virtual directory:
Expand Tomcat5.x.x> conf, use Notepad to open "server.xml" to move the cursor to the end of the file, with the following code:
Add the following code before the host> tag
Directory = "logs" prefix = "localhost_log." suffix = ". txt" TimeStamp = "true" /> Host> Engine> Service> Server> The red portion of the code is just the code, where "path" refers to the directory in the URL. If it is empty, it is mapped to "http://127.0.0.1:8080" (Tomcat default port is 8080), if " / TEST "is mapped to" http://127.0.0.1:8080/test ". This allows you to access the above URL in the browser, and of course you can add other virtual directories. By the way, change Tomcat's port number to the default "80", only need to change the "server.xml" file: port = "8080" maxThreads = "150" minSpareThreads = "25" maxSpareThreads = "75" enableLookups = "false" redirectPort = "8443" acceptCount = "100" debug = "0" connectionTimeout = "20000" disableUploadTimeout = "true" /> The "8080" in the code is changed to "80" to access the IE default port, i.e., when entering the URL, the port number can be used as: "http://127.0.0.1". Ok, the virtual directory is simply written here, and then slowly say more in more detail later.