TOMCAT
1. 1Tomcat startup and configuration
-
Folder function:
-
Startup, shutdown (bin->startup.bat/shutdown.bat) — Tomcat website
Possible problems with configuration:
- Java environment variables are not configured
- Crash back, need to configure compatibility
- Garbled, set in the configuration file
You can configure the port number to start:
- The default port number of tomcat is: 8080
- mysq|: 3306
- http: 80
- https: 443
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
The name of the host can be configured:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
- The default host name is: localhost->127.0.0.1
- The default website application storage location is: webapps
Interview question: please talk about how the website is accessed
- Enter a domain name and press enter
- Check the local C:\Windows\System32\drivers\etc\hosts configuration file for this domain name mapping
- Yes: return the corresponding ip address directly, this address contains the web program we need to access, which can be accessed directly
- No: Go to the DNS server to find, return if found, return not found if not found
1. 2 Publish a Web site
Put the website you wrote in the folder (webapps) of the web application specified in the server (Tomcat), and you can access it
- The structure of the website
-webapps Tomcat服务器的web目录
-ROOT
-XXX :网站的目录名
-WEB-INF
-classes java程序
-1ib web应用所依赖的jar包
-web.xm1 网站配置文件
- index.htm1 默认的首页
- static
-CSS
-sty1e.css
-js
-img
-......