JavaWeb] [Web-related concepts and Tomcat configuration

Web-related concepts

Software Architecture

Two modes:

  1. C / S: Client / Server
  2. B / S: browser / server (Key)

Advantages of browser / server model: server-side changes without notice to the client.

Resource classification

1. static resources

  • After all user access, the result is the same, called static resources. For example: html, css, JavaScript

2. Dynamic Resource

  • After each user access to the same resources, the result may be different. Called dynamic resource. After the dynamic resource being accessed, you need to convert a static resource, and then returned to the browser. Such as: servlet / jsp, php, asp ....

Three elements of the communication network

1. IP address

Electronic device is unique in the network.

2. Port

Application uniquely identifies your computer, ranging from 0 to 65526 ​​is recommended to write 1000 or more.

3. Transfer Protocol

Rule data transmission, such as TCP and UDP.

Web server software

1. Server

  • Computer server software is installed.

2. Server Software

  • Receiving a user's request, process the request, responds.

3.Web server software

  • Receiving a user's request, process the request, responds. In the Web server software, you can deploy web projects, allowing users to access these resources through a browser.
  • web container

Common Web server software

1.WebLogic

oracle company, large JavaEE server, JavaEE specification supports all charges.

2.WebSphere

IBM, large JavaEE server, JavaEE specification supports all charges.

3.JBOSS

JBOSS, large JavaEE server, JavaEE specification supports all charges.

4.Tomcat

Apache Fund, small and medium JavaEE server that supports JavaEE specification part of the free open source.

 

Tomcat

1. Directory structure

 2. Start

bin / startup.bat, double-click the file to run

3. Access

Enter the browser: http: // localhost: 8080 Enter access their own, http: // others ip: 8080 people visit

4. Modify the port number itself

Located in conf / server.xml file,

<Connector port="8080" protocol="HTTP/1.1"  //可以将8080修改
connectionTimeout="20000"
redirectPort="8445" />

 The default port number of the general will is 80.80 tomcat port number is the default port number for http protocol. Benefit is when you visit, do not enter the port number.

5. Close

1. Shut down:

  • bin/shutdown.bat
  • ctrl+c

2. Force off:

  •  Click Start window ×

6. deployment project by:

1. Direct the project into the webapps directory.

              / Hello: access path of the project -> Virtual Directory

              Simplify deployment: the project package labeled as a war, then war pack is placed under the webapps directory.

               war package will automatically unzip

2. Configure the conf / server.xml file

                Disposed <Host> tag body

                 <Context docBase="D:\hello" path="/hehe" />

                 docBase: items stored path

                 path: Virtual Directory

3. (the recommended way) in conf \ Catalina \ localhost create xml file any name. Written in the file

                <Context docBase="D:\hello" />

                 Xml file name: Virtual Directory

Published 169 original articles · won praise 101 · views 70000 +

Guess you like

Origin blog.csdn.net/zzu_seu/article/details/104999058