Web introduction and tomcat installation

Source: Internet
Author: User
Tags apache tomcat

 

1. Web Application Introduction:

(1) Applications: software programs that allow users to execute specific tasks, mainly divided into desktop applications and Web applications.

(2) desktop applications: generally applications that use the client and server structures (Client/Server mode)

Advantages of desktop applications:

The C/S Mode separates applications from services, and the system has stability and flexibility.

The C/S mode is equipped with a point-to-point structure mode, which is suitable for LAN and provides reliable security.

The client can directly connect to the server without any intermediate links, so the response speed is fast.

Disadvantages of desktop applications: in C/S mode, the client program must be installed on the computer as the client. Once the software system is upgraded, the client program must be installed on each client, system upgrade and maintenance are complex.

(3) Web Applications

Web applications: generally refers to applications (Browser/Server) that use browser and server structures and are composed of web servers and web clients.

Web server: the Web server is installed with an application. The web server application is responsible for receiving and processing customer requests and returning results to the customer.

Web Client: allows users to request a resource on the server and return results to the client. A Web application client generally refers to a web browser.

Advantages of the B/S mode:

3.1 ease of maintenance: to upgrade or maintain a system based on the B/S model, you only need to modify the server program.

3.2 ease of implementation: the presentation layer of the B/S model can be implemented using HTML for making web pages. The browser and web page design technologies are quite mature. Moreover, web systems developed using Java technology can be installed on any server system platform, which is often called cross-platform.

3.3 ease of use: No matter where the customer is, as long as the server is running, the customer can connect through the network to access and operate data.

(4) differences between desktop applications and Web applications:

The difference is that web applications are browser-based and have a wide range of application platforms, while desktop applications are only available on the local machine.

 

2. Web application knowledge

(1) HTTP protocol:

(2) URL: Uniform Resource Identifier: used to locate unique entity Resources

Format: Protocol: // host name: Port/(root path of the site)/Name of the accessed file

Http://www.it315.org: 80/Java/index.html

(3) Main web server software:

The web server software can be installed on the Web server: IIS Apache Tomcat

Tomcat can be used directly as a web server or as a JSP or serleert engine.

 

3. website system composition ------------------ topology of large website Systems

 

Operating theory of large website systems:

If a website has a large amount of traffic, it is impossible for a Web server to be available. In this case, we need multiple Web servers to work together to reduce the load on one server. However, no matter which server is processing the request, the client browser should obtain the same result as accessing a separate server. The client browser does not know that the request and the previous request may be handled by different servers. This requires that the content on each web server here be exactly the same, the running status should be synchronized and consistent. Multiple servers that meet this requirement constitute a web server cluster system. When a website uses such a web server cluster system, the client browser should not know that there are multiple such Web servers on the server side. The client browser always accesses the same IP address, in this case, we need such a device to allocate the same IP address request sent by these client browsers to multiple Web servers. This is the Server Load balancer system. All client access requests are routed to the Server Load balancer system. Then, the Server Load balancer system tracks and records the load of each Web server, and distributes the requests to the Web server with a lighter load, this is the role of the Server Load balancer system. The functions and working principles of the Database Cluster System and the Web server cluster system are similar.

In addition, some large websites set up regional proxy servers in different regions to improve the access efficiency of Client browsers and reduce the traffic on backbone networks. Client browsers in different regions access the regional proxy server, rather than directly accessing the remote web server. The website like Sina basically adopts this architecture. When we access "www.sina.com" through a browser, we do not access the Web server in Beijing, but the regional proxy server of Sina in Hebei.

 

 

DNS server: During access, the IP address of the regional proxy server is recorded and the IP address of the proxy server in this region is returned. The IP address corresponding to the domain name is recorded, the address of the regional proxy server is returned.

Note: a domain name corresponds to multiple IP addresses.

Lecture 2: install Tomcat

1. Tomcat introduction:

Http://jakarta.apache.org access site to demonstrate

To download http://tomcat.apache.org

2. Get the installation package

The tar.gz file is the installation version of the Linux operating system.

Ü EXE is the installation version in windows.

Ü ZIP files are compressed in windows.

Introduction to folders under the installation package:

Bin is an executable file.

Conf stores the configuration file

Logs stores information about running logs.

Work work folder

Webapps place the created web programs

3. Some precautions during running:

(1) The system has a cache after the page is closed and displayed on the original page.

(2) Ctrl + C terminate Tomcat

Telnet localhost 8080 in the black screen to connect Tomcat

(3) if it cannot be opened after installation, it may be because the port is occupied, or it may be due to a port conflict.

Check whether the port is occupied in the black window: netstat-na

Use ffort to view the usage of the application

Use netstat for active ports

After finding the occupied window, modify the port.

Modify the Start port: In the conf file, find the server -------- cibbection port: 8081.

 

Lecture 3: configure the virtual directory of the web site

1. Concepts and Principles of virtual web directories

Http://www.it315.org: 80/Java/index.html

/Represents the virtual root directory, with only one (corresponding to the touch directory on the disk)

Note: As long as there is a root directory and there are two local folders under the same file, you can also map one of them to a virtual subdirectory, the Directory of a file system can be mapped to a virtual web directory.

2. ing principle of virtual web directories

In the configuration file, replace conf with the --ing statement in the host tag ----------.

(1) root directory ing

<Context Path = "" docbase = "Path of the file to be mapped" DEBUG = "0">

When accessing http: // localhost: 8080/1 -1-1.html

(2) maps subdirectories in the local directory.

<Context Path = "/book" docbase = "Path of the file to be mapped" DEBUG = "0">

Http: // localhost: 8080/book/1-1-1.html

<Context Path = "/it315" docbase = "Path of the file to be mapped" DEBUG = "0">

Http: // localhost: 8080/it315/1-1-1.html

(3) Multi-Level ing:

<Context Path = "/student/myweb/XXX" docbase = "Path of the file to be mapped" DEBUG = "0">

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.