Virtual host configuration method in tomcat5.x

xiaoxiao2021-03-06  75

Get a period of Web project (based on JSP JavaBean technology, the server is Apache Tomcat) found that our project files are placed in Tomcat_Home \WebApps, although we can configure our project to other directories via Server.xml, but when When the project is more, the server.xml will become bloated, and the confusion is unable to manage and maintain. In order to avoid the above cases, it will be more convenient for the project to be more convenient to manipulate, including one or two virtual hosts that only configure one or two virtual hosts in Server.xml to solve the centralized management of the project, and the configuration files required for each project are also You don't have to add it to Server.xml, so that Server.xml is no longer bloated, not chaotic, but more to manage and maintain. After half a day, I have to be jumped so early. If I still have to come with me, what are you waiting for! (^_^) First, prepare: Suppose you are a web programmer, and you can understand Tomcat, and you can For regular configuration 2, start configuration: 1, first in the tomcat_home / conf directory to find the server.xml file and open it in Notepad; 2,) Find tag in file server.xml; 3 , Newly created the following information after the tag: Description: [Onion] for your host name or domain name; [f] / Studioonion / web_project] is the starting directory of the virtual host; [onion_log] is the log file name; [Onion_access_log] is the log file name of the host. 4, in the start directory of the virtual host, build a directory and a configuration file with the project with the project (my F: / Studioonion / Web_Project / SHSC / and F: / STUDIONONON / Web_Project / SHSC.XML ). 5.) Open the basic information that has just been built to configure the basic information of your project (such as virtual directory and real path, etc.), in short, almost all configurations can be completed in this configuration file, of course, servlet and bean deployment To do it in web.xml, this article does not involve this so that this will not be described here.

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

New Post(0)