search
HomeBackend DevelopmentPHP TutorialCognitive Web Server_PHP Tutorial
Cognitive Web Server_PHP TutorialJul 13, 2016 pm 05:22 PM
webmaincontentFunctionandexistMulti-usersupplyserverofnetcognition

In the eyes of many users, the success or failure of a Web website mainly depends on the content and functions it provides. Little do they know that the Web server that supports these contents and functions is the real hero behind the scenes. According to statistics, there are more than 5 million websites in the world. There is a web server running behind every website, so what is a web server? How does it work? ...... From C/S to Web The earliest network system was a simple host/terminal system. All applications were completed by the host, and the terminal just ran the corresponding program on the server. The arrival of the PC era has led to great development of computer networks and computer applications. Due to the continuous decline in PC prices and the continuous improvement in performance, the application fields of terminal-oriented mainframes have become less and less. In particular, the rise of network operating systems such as NetWare and Windows NT, as well as the emergence of network database systems, has opened up a new model of network applications - C/S (Client/Server) model. The C/S model is a two-layer structure system. The first layer handles presentation logic and business logic on the client, and the second layer is a server system such as a database running through the network. The C/S mode separates transactions and realizes distributed computing on the network. It has also helped enterprises realize the construction of local area networks for a long time, improved internal business management of enterprises, and improved work efficiency. However, the C/S model has obvious limitations in terms of system integration and maintenance, operation interface consistency, and system scalability. Therefore, just as the host/terminal network is replaced by the C/S model network system, In the Internet/Intranet technology environment, newer system models will also appear. Internet/Intranet based on Web technology has been widely used in recent years. Intranet is an enterprise intranet based on TCP/IP protocol and with Web as the core. Users can access it at any time through a low-cost, easy-to-use customer browser. Go to the enterprise's Web site to check the data you need anywhere. The consistency of the browser client operation interface avoids the diversity of client programs in C/S mode, while the open and standards-based connection solution on the server side makes it easy for enterprises to contact the outside world through the Internet; at the same time, Web information is dynamic and The interactive publishing method fundamentally changes the service quality of enterprises and increases their business opportunities. Figure 1 Web three-tier structure In the three-tier structure of Web technology, the database does not directly provide services to each client, but communicates with the Web server to achieve dynamic, real-time and interactive customer information services. This functionality is achieved through server applications such as CGI, ISAPI, NSAPI, and Java. As shown in Figure 1. What is a Web Server? The unique feature of Web technology is the use of hyperlinks and multimedia information. Web servers use HyperText Marked Language (HTML-HyperText Marked Language) to describe network resources and create web pages for reading by Web browsers. The characteristic of HTML documents is interactivity. Whether it is general text or graphics, it can be connected to other documents on the server through links in the document, allowing customers to quickly search for the information they want. HTML web pages can also provide forms for users to fill out and submit to the database through server applications. This kind of database generally supports multimedia data types. Web browser (Web Browser) is a client application used for document retrieval and display, and is connected to the Web server through the Hypertext Transfer Protocol HTTP (HyperText Transfer Protocol). The universal, low-cost browser saves the development and maintenance costs of the two-tier structure C/S mode client software. Currently, in addition to providing basic document retrieval, display and navigation features, the popular Internet Explorer and Netscape Navigator also support advanced HTML display (such as tables and frames) as well as ActiveX, Java, JavaScript and other features. How does a Web server work? In the eyes of many users, the success or failure of a Web website mainly lies in the content and functions it provides. However, they do not know that the Web server that supports these contents and functions is the real hero behind the scenes. So, how does a web server work? A few years ago, when the Web server first appeared, the applications it supported were simple browsing of HTML files and images. When the Web server received a request for a Web page, such as http://www.ccidnet.com. index.html, it will locate the corresponding host file server through the URL (Uniform Resource Locator-Uniform Resource Locator), find the corresponding file index.html, and then download the file from the host file server and use the HTTP protocol to It is transmitted to the Web browser (Web Browser). Of course, this is just a basic function, and the relationship between the web server and the web browser is far from simple. One of the most important extensions of web applications is the introduction of dynamic content. For example, a web server can directly or indirectly create a web page based on a request entered by a user, and then return it to the web browser. The earliest way to implement dynamic content applications is through CGI (Comman Gateway Interface), which has a basic definition for the running of programs on the Web server and the transmission of dynamic content between the Web server and the Web browser. As shown in Figure 2.Another development in Web applications is the emergence of HTTPS (HyperText Transmission Protocol, Secure Hypertext Transfer Protocol), which ensures the security of communication between Web servers and Web browsers, making electronic transactions possible. The communication between the web server and the web browser is through the HTTP protocol. So, what is the HTTP protocol? Simply put, the HTTP protocol is an application layer protocol between a web browser and a web server. It is based on the TCP/IP protocol and is a universal, stateless, object-oriented protocol. Its working principle includes four steps: Figure 2 CGI definition diagram Connection: The web browser establishes a connection with the web server and opens a virtual file called socket. The establishment of this file marks a successful connection. Request: The web browser submits a request to the web server through the socket. Response: After the web browser submits the request, it is sent to the web server through the HTTP protocol. After receiving it, the web server performs transaction processing, and the processing results are sent back to the web browser through HTTP, thereby displaying the requested page on the web browser. Close the connection: When the response is completed, the web browser and the web server must be disconnected to ensure that other web browsers can establish connections with the web server. In this way, the Web server's processing includes a complete logical stage: accept the connection - generate static or dynamic content and send them back to the browser - close the connection - accept the next connection, and so on. It is conceivable that when there are many visitors, the server will inevitably be overwhelmed. Two technologies can be used to solve this problem: multi-threading and multi-process. The web server supports the port monitoring module of Unix systems (a multi-process mode), multi-threading, multi-process or a mixture of the two technologies. With the connection, how does the web server provide content to the web browser? The key here is that the content must be recognized and represented by the browser. The main mechanism that determines how to display content is the MIME (Multiple Purpose Internet Mail Extension) type. MIME tells the web browser what kind of document will be sent. Moreover, this type of identification is not limited. For simple image documents and HTML documents. For example, there are 370 default MIME types in the mine.type configuration file of Apache WebServer, and this is not all MIME types. MIME types are distinguished by a type/subtype syntax associated with the file suffix, for example, a file containing MPEG video content would have the suffix mpeg, mpg, or mpe. The role of the Web server is ultimately reflected in the provision of content, especially dynamic content. This is also the fundamental difference between a Web server and an application server. The Web server is mainly responsible for providing dynamically generated HTML documents when interacting with the Web browser (in addition to providing HTML document services In addition, the Web server also provides application data such as XML format. In other words, the Web server not only provides HTML documents, but can also establish connections with various data sources on a larger scale to provide richer content for the Web browser. .) There are many technologies to implement dynamic content on the Web. The first is CGI, which dynamically transmits HTML data according to requests entered by the user. CGI is not a development language, it is just a protocol that can use programs written for it to implement a Web server. Since each request for dynamic content requires starting a new CGI program, which increases the burden on the Web server, a big drawback of CGI is that it easily affects the speed of the Web server. Microsoft ASP (Active Server Pages - Dynamic Server Pages) technology consists of a VBScript interpreter embedded in IIS. It also supports a variety of scripting languages, including JavaScript, PerlScript and VBScript. Based on COM, it can be easily accessed Other server software components. PHP, like JSP and ASP technologies, consists of a set of additional code tags placed in an HTML document. The difference is that it is designed for developing Web pages, so applications developed with it will be simpler than corresponding applications developed with VBScript or JSP. All web servers today support Perl acceleration solutions. Apache's free mod_perl solution embeds Perl into the Apache server. This not only improves the interpretation speed of Perl code, but also greatly improves the execution efficiency of the code due to mod_perl caching. Mod_perl is also closely linked to Apache, so Perl developers can control the work of the Web server just like C developers writing low-level Apache API programs. When the system is running, the Web server often has to support a large number of intensive user clicks and the demand for dynamic content. Therefore, even with high-end server equipment, in the face of an increasing number of users, the number of visits supported per unit time will increase. There is a limit, especially for situations with a lot of dynamic content, because the application of dynamic content requires frequent calls to database data and applications, which will occupy a lot of server resources. At this time, it is necessary to distribute the server load between multiple server devices or multiple sites. There are many methods of load balancing. The simplest method is to distribute the content of the website between different servers. For example, store static HTML pages on one server, store image files on another, and run all CGI programs on a third server.However, it is obvious that this method will not be very efficient, because it cannot achieve automatic content distribution between hosts. If there is too much content in one aspect, it will still form a load bottleneck. The basic method of DNS load balancing (Domain Name Server) is to place different copies of the same site on the same physical server. Then, the DNS server can return multiple IP addresses. The method is that the DNS server can return both domain names. Multiple IP addresses can also return different IP addresses for the same DNS request. Since it is difficult to determine which IP address a client corresponds to, DNS can only provide basic load balancing services. Moreover, because the DNS request remains in the cache of the client and other servers, the same client will continue to access the same Web server. Therefore, it is possible that a large number of users who frequently access the Internet use one IP address, while other users who rarely access the Internet access another IP address, resulting in uneven distribution. Another problem is that the DNS cache is not continuously activated, which may cause a client to end access to other IP addresses of the site while it is using a Web site. This can cause problems for dynamic websites, especially if you need to accept and store data from the client. The software and hardware load balancing method is similar to DNS load balancing, but the website only publishes one IP address, and a machine is specially set up to accept HTTP requests for this IP address and distribute these requests to various servers of the website. This distribution typically occurs at the TCP/IP routing level, which transparently maps this single source/destination IP address to a specific server. This technology

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532255.htmlTechArticleIn the eyes of many users, the success or failure of a Web website mainly depends on the content and functions it provides, but they do not know that supporting these The content and functionality of the web server are the real heroes behind the scenes. According to statistics...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Web Speech API开发者指南:它是什么以及如何工作Web Speech API开发者指南:它是什么以及如何工作Apr 11, 2023 pm 07:22 PM

​译者 | 李睿审校 | 孙淑娟Web Speech API是一种Web技术,允许用户将语音数据合并到应用程序中。它可以通过浏览器将语音转换为文本,反之亦然。Web Speech API于2012年由W3C社区引入。而在十年之后,这个API仍在开发中,这是因为浏览器兼容性有限。该API既支持短时输入片段,例如一个口头命令,也支持长时连续的输入。广泛的听写能力使它非常适合与Applause应用程序集成,而简短的输入很适合语言翻译。语音识别对可访问性产生了巨大的影响。残疾用户可以使用语音更轻松地浏览

如何使用Docker部署Java Web应用程序如何使用Docker部署Java Web应用程序Apr 25, 2023 pm 08:28 PM

docker部署javaweb系统1.在root目录下创建一个路径test/appmkdirtest&&cdtest&&mkdirapp&&cdapp2.将apache-tomcat-7.0.29.tar.gz及jdk-7u25-linux-x64.tar.gz拷贝到app目录下3.解压两个tar.gz文件tar-zxvfapache-tomcat-7.0.29.tar.gztar-zxvfjdk-7u25-linux-x64.tar.gz4.对解

web端是什么意思web端是什么意思Apr 17, 2019 pm 04:01 PM

web端指的是电脑端的网页版。在网页设计中我们称web为网页,它表现为三种形式,分别是超文本(hypertext)、超媒体(hypermedia)和超文本传输协议(HTTP)。

web前端和后端开发有什么区别web前端和后端开发有什么区别Jan 29, 2023 am 10:27 AM

区别:1、前端指的是用户可见的界面,后端是指用户看不见的东西,考虑的是底层业务逻辑的实现,平台的稳定性与性能等。2、前端开发用到的技术包括html5、css3、js、jquery、Bootstrap、Node.js、Vue等;而后端开发用到的是java、php、Http协议等服务器技术。3、从应用范围来看,前端开发不仅被常人所知,且应用场景也要比后端广泛的太多太多。

Python轻量级Web框架:Bottle库!Python轻量级Web框架:Bottle库!Apr 13, 2023 pm 02:10 PM

和它本身的轻便一样,Bottle库的使用也十分简单。相信在看到本文前,读者对python也已经有了简单的了解。那么究竟何种神秘的操作,才能用百行代码完成一个服务器的功能?让我们拭目以待。1. Bottle库安装1)使用pip安装2)下载Bottle文件https://github.com/bottlepy/bottle/blob/master/bottle.py2.“HelloWorld!”所谓万事功成先HelloWorld,从这个简单的示例中,了解Bottle的基本机制。先上代码:首先我们从b

web前端打包工具有哪些web前端打包工具有哪些Aug 23, 2022 pm 05:31 PM

web前端打包工具有:1、Webpack,是一个模块化管理工具和打包工具可以将不同模块的文件打包整合在一起,并且保证它们之间的引用正确,执行有序;2、Grunt,一个前端打包构建工具;3、Gulp,用代码方式来写打包脚本;4、Rollup,ES6模块化打包工具;5、Parcel,一款速度极快、零配置的web应用程序打包器;6、equireJS,是一个JS文件和模块加载器。

深入探讨“高并发大流量”访问的解决思路和方案深入探讨“高并发大流量”访问的解决思路和方案May 11, 2022 pm 02:18 PM

怎么解决高并发大流量问题?下面本篇文章就来给大家分享下高并发大流量web解决思路及方案,希望对大家有所帮助!

web是前端还是后端web是前端还是后端Aug 24, 2022 pm 04:10 PM

web有前端,也有后端。web前端也被称为“客户端”,是关于用户可以看到和体验的网站的视觉方面,即用户所看到的一切Web浏览器展示的内容,涉及用户可以看到,触摸和体验的一切。web后端也称为“服务器端”,是用户在浏览器中无法查看和交互的所有内容,web后端负责存储和组织数据,并确保web前端的所有内容都能正常工作。web后端与前端通信,发送和接收信息以显示为网页。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools