Tomcat - Web application server
By learning the installation and use of Tomcat , the video is quite short, about 2 hours, but I personally feel that the explanation is not very good. If you want to learn tomcat, you can try other videos.
1. Introduction to BS and CS
1)CS
2)BS
2. Introduction to server software
2.1 tomcat download and installation instructions
http://tomcat.apache.org Download
Download the appropriate version. For example, blogger jdk11 chose apache-tomcat-8.5.84
tomcat的安装目录介绍:
bin:可以执行文件。
conf:tomcat服务器的配置文件
lib:tomcat启动后需要依赖的jar包
logs:tomcat工作之后的日志文件
webapps:是tomcat布暑工程的目录。
work:jsp文件在被翻译之后,保存在当前这个目录下,session对象被序列化之后保存的位置
2.2 tomcat startup
tomcat directory/bin/startup.bat (window startup file) Find startup.bat and double-click to run it. There will be a black window. Do not close the black window.
Enter: http://localhost:8080 or http://127.0.0.1:8080 in the browser address bar. If you see the page, it proves that the startup is successful.
2.3 Configure tomcat port
The default port of tomcat is 8080 (access port).
The default port of http is 80. If you enter http://www.baidu.com when accessing, it is equivalent to http://www.baidu.com:80. When the project is actually online, 80 is usually used. The modification method is as follows:
1) Find the tomcat directory/conf/server.xml
2) Modify the value of the port to 80 3) Then enter http in the browser: //127.0.0.1:80 or http://127.0.0.1 access test
2.4 tomcat shutdown
Find the /bin/shutdown.bat file in the tomcat directory and double-click it to shut down Tomcat.
3. Project deployment
3.1 Deploy the project to Tomcat
- Copy the website directory to the tomcat/webapps directory (commonly used, must be mastered)
. If you have a website (a folder), copy the folder to tomcat's webapps directory. - Compress our project into a zip file, change it to war, and copy the war file to the tomcat/webapps directory.
3.2 Project access
- localhost/project name/index.html
- Or tomcat gui to access
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
5. IDEA integrated with Tomcat
For details, see Configuring Tomcat in IntelliJ IDEA | Java Basics Tutorial