Preface:
After the Tomcat is installed, we enter the URL (or IP) and visit Tomcat, which appears as the Tomcat welcome interface, as follows:
Then how can you enter the address to access our own published default welcome interface. The method is as follows:
First, open the Tomcat/conf/server.xml file and locate the following code snippet:
Second, add a line of code between <Host></Host> tags:
<context path= "" docbase= "Now" debug= "0" reloadable= "true"/>
After the change is done as follows:
Where path is the name of the virtual directory, and if you want to display the home page with just the IP address, the key value is left blank; Debug and reloadable are generally set to 0 and true. What's actually going to change is
Docbase This amount, it specifies the folder where the default home page of the login Tomcat is located, which is designated by default as the root folder and now in the current folder, so we need to create a new today folder in the WebApps directory, Then put our own page files in the now folder. Then we need to have a index.html or index.jsp file, which is specified in the Web.xml file, in order to find the file at the beginning of the index, in the following order:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file> index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</ Welcome-file-list>
This is the setup of the Tomcat Conf/web.xml file, which means that the files we put in the now folder need to have one of the names of the top three files, so Tomcat will load the corresponding file as the default welcome home (and, of course, it can be conf/ Web.xml inside Change the name of the default home page).
The above settings are complete.
PS: If you want to change the tomcat default port, do not want to add 8080 to the back of the URL, you can also modify server.xml this file to achieve, find the following code:
<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000"
redirectport= "8443"/>
Change the 8080 to 80 port, so you don't have to specify the port.