Know and use Tomcat
1. What is Tomcat
First of all, let's look at the explanation of Baidu Encyclopedia.
To summarize, tomcat is a middleware. In the B/S architecture (browser/server), the http request sent by the browser is forwarded to the final destination server through the tpmcat middleware, and the response The message is then returned to the browser through tomcat.
2. Download Tomcat
Download from the official website; https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/net
disk link in the comment area, download according to your own preferences
3. Understand the directory structure of Tomcat
We open the tomcat folder
4. Using Tomcat
4.1 Check if Tomcat has been started
a) Enter the bin directory - click the corresponding startup program ( note: do not close the window )
b) Visit tp://localhost:8080/, the following page appears, the visit is successful
4.2 Publish the project using Tomcat
a) Open webapps (web publishing directory file), create a new file
b) Open the examples file, copy the following files to the new directory
c) We mainly edit the index file, we also look at the directory structure of the web-inf file
Edit the index file
d) Restart tomcat, close and open it in the bin directory, visit http://localhost:8080/oakhachi, the result is as follows (oakhachi here is the name of my own newly created folder) I
believe you have probably known our "tom cat" ", If you keep publishing the project like this, it will be a bit too troublesome. In the next chapter, we will use the idea to use Tomcat to publish the project. Of course, the most important thing is to know these basics.