Use Tomcat to build a web environment (1)

Build a web environment

Use Tomcat to deploy web projects

Program structure:

Goals: 1. Understand the concepts of C/S and B/S architecture

​ 2. Deploy website using Tomcat

1. C/S and B/S

1. Difference One

C/S: Client/Server-downloading software packages, that is, the client, sending messages and operations are dependent on the server

B/S: Broswer/Server-After entering the URL, we can directly get the corresponding and visit the server

2. Difference two

C/S applications are generally used in a relatively small network range

B/S is used in the wide area network, has a stronger application scope than C/S, and is more convenient in software maintenance and update

The working principle of B/S architecture: request and response mode to interact

URL: URL-Uniform Resource Locator

3. Server

The so-called server is a computer, according to different needs, for example:

Picture server, file server, database server, cache server, application server, etc.

Common web servers:

IIS、Apache:Tomcat、Oracle:WebLogic等

4. Tomcat server:

Open source projects under Apache

Lightweight application server

Open source, stable, low resource usage

Tomcat download:
Tomcat directory structure

**/bin:** A lot of batch processing files, the batch file for startup to start the server, bat is the windows operating system, .sh is the Linux system, shutdown is the stop
**/conf:** configuration means, save The configuration file context.xml related to tomcat server, server.xml is to configure some startup port numbers

**/Nib:** stores various JAR files needed for the tomcat server lock
**/temp:** stores temporary files
**/logs:**some log files
**/webapps:**when publishing web applications, By default, the web application files are stored in this directory
**/work:** This file is some cache files generated by the web project, such as JS Servlet

Notes on operating Tomcat

1. After startup.bat is started, it must not be closed, it must be minimized
2. When starting, the window flashes by?
jdk: After configuration,
environment variable path: D:\ ……\bin
environment variable JAVA_HOME:D:\ ……
3. http://localhost:8080/port number modification (/conf/server.xml)

How to deploy a static website in tomcat

Copy the file to the webapps directory

Two, deploy the web

Deploy a web project in the development tool

Guess you like

Origin blog.csdn.net/zjdzka/article/details/111824881