web services important points

HTTP: Hypertext Transfer Protocol, the default is TCP 's 80 ports. Text with hyperlinks, and these links as a hyperlink!

loadrunner: Professional testing tool, a virtual reality of your application for evaluation!

HTML: Hypertext writing language.

HTML document: Achieving these dispersed across multiple web integration of resources on the server into a page, and allows the browser to display.

 

URI: Uniform Resource Identifier, can be used to define the only way a reference to the naming of an independent resource on a global scale! It includes, but is not the only reference to the Internet.

    The only mark to locate a resource access path way on the path to unified format.

URL: Uniform Resource Locator child object Uniform Resource Identifier, Uniform Resource Locator! Used to describe Internet resources on the Internet unified representation format.

      URL path to the local path is not the same thing.

      URL is relative to the httpd profile DocumentRoot path in terms of the relative path.

How to represent?

Indicate agreement to acquire resource: // Specify what server on the host: Specifies the host to get in that port / path on the corresponding server / file

       http://www.baidu.com/sun/sun/txt

web resources / web objects: a unique identifier mark his mark by Uniform Resource Locator, and allows clients to access its files!

                   More resources are likely to be integrated into an HTML document!

 

Apache is the world's number one use of Web server software

httpd is the Apache HyperText Transfer Protocol (HTTP) main server.

Resources way / http ways:

   MIME: Multipurpose Mail Extensions, re-encoding the non-text data in a text format prior to transmission, the receiver can be used to re-reverse manner to restore to the original format, you can open this file by using the program.

   SMTP: Simple Mail Transfer Protocol, can only transmit pure text,

index.heml: reference n a web objects, the URL of .

Listening: listening on a port, waiting for client requests. Once the user came to know a user to access the kernel.

 

The number of concurrent connections supported by the three models

prefork MPM: a process in response to a request, up to 1021 th

worker MPM: a process in response to a thread, multi-process, a process to generate multiple threads,

event MPM: event-driven, better than the above two

 

 

HTTP packets ----> request packet, response packet.

  http neck:

    GET / ....: To get the file

    HOST: host name: To obtain resources on the host

 

Request message format (client request)

Start line   <method>: resource acquisition method    <the URL-Request> : you what resources are requested (route)  <Version> : the version number of the protocol corresponding to the request ( 1.0 / 0.9 )

报文首部  <headres>:http协议首部

空白行

<entity-body>:报文主体(报文内容)

 

响应报文的格式(服务器响应)

起始行  <version>:对应的版本   <status>:状态代码   <reason-phrase>:详细解释状态代码返回的信息

报文首部<headers>:响应报文首部

空白行               空白行

报文主题  <entity-body>:报文主体(报文内容)

 

状态代码 (你请求的结果是正确的还是失败的?)5类!

   1xx:纯信息

   2xx:成功类状态信息,请求内容成功。

         200:请求内容正常

   3xx:重定向类信息,你请求的内容存在,但被挪到其他地方去了。

         301:永久挪到其他地方

         302:临时重定向

         304:没有发生任何改变

   4xx:客户端错误类信息

         404:请求了一个不存在的文件

   5xx:服务器端错误类信息


web服务器的主要操作

1、建立连接----->接受或拒绝客户端连接请求

2、接受请求----->通过网络读取HTTP请求报文

3、处理请求-----> 解析请求报文并做出相应的动作

4、访问资源-----> 访问请求报文中相应的资源

5、构建响应-----> 使用正确的首部生成http响应报文

6、发送响应----->向客户端发送生成的响应报文

7、记录日志----->把已经完成的http事务记录进日志文件

 

缓存:每一个资源都要单独请求一次,(每张照片、每个超链接),所以,我们的服务器都是多线程的。将访问的东西都缓存到本地,第二次打开时会非常快。

http0.9版本:引入了MIME功能+

http1.1版本:加强缓存管理功能,引入长连接

              长连接:客户端和服务器之间获取一个资源之后不断开,持续获取之后的资源,获取资源时间减少。

                         限定:1、空闲超时,若你请求完第一个、第二个资源之后再也不请求了,就让你断开,让后面人获取资源。

                               2、最多让你请求多少次

服务器处理模型(多道处理模块)

单线程服务器模型:有多个客户端请求,服务器处理完一个请求报文之后再处理第二个,依次执行。

多线程服务器模型:有多个客户端请求,服务器进程不直接响应给客户端,他只接受客户端请求。第一个请求来了,服务器自己不响应,

                   他生成一个子进程,让子进程去处理,第二个客户端请求,再次生成一个子进程,让新的子进程处理。服务器本身只接

                   收请求,让子进程去处理。

多进程,多线程:有一个主进程,和好多子进程,每个进程都能同时处理多个请求.


Guess you like

Origin blog.51cto.com/10784316/2425139