Apache Tomcat 5.0.2x virtual directory configuration

xiaoxiao2021-03-06  72

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 "" tag that uses this tag to configure the virtual directory. But I don't know why, I gave this label in Tomcat, we had to manually add this label.

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 tag

Directory = "logs" prefix = "localhost_log." suffix = ". txt" TimeStamp = "true" />

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.

转载请注明原文地址:https://www.9cbs.com/read-92368.html

New Post(0)