嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器外文翻譯@中英文翻譯@外文文獻(xiàn)翻譯_第1頁(yè)
嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器外文翻譯@中英文翻譯@外文文獻(xiàn)翻譯_第2頁(yè)
嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器外文翻譯@中英文翻譯@外文文獻(xiàn)翻譯_第3頁(yè)
嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器外文翻譯@中英文翻譯@外文文獻(xiàn)翻譯_第4頁(yè)
嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器外文翻譯@中英文翻譯@外文文獻(xiàn)翻譯_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

付費(fèi)下載

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) - 7 - The DIL/NetPCs DNP/1110 Using the Embedded Linux Web Server for Embedded Systems After the “everybody-in-the-Internet-wave” now obviously follows the “everything-in-the-Internet-wave”. The most coffee, vending and washing machines are still not available about the worldwide net. However the embedded Internet integration for remote maintenance and diagnostic as well as the so-called M2M communication is growing with a considerable speed rate. Just the remote maintenance and diagnostic of components and systems by Web browsers via the Internet, or a local Intranet has a very high weight for many development projects. In numerous development departments people work on completely Web based configurations and services for embedded systems. The remaining days of the classic user interface made by a small LC-display with front panel and a few function keys are over. Through future evolutions in the field of the mobile Internet, Bluetooth-based PANs (Personal Area Networks) and the rapidly growing M2M communication (M2M=Machine-to-Machine) a further innovating advance is to be expected. The central function unit to get access on an embedded system via Web browser is the Web server. Such Web servers bring the desired HTML pages (HTML=Hyper Text Markup Language) and pictures over the worldwide Internet or a local network to the Web browser. This happens HTTP-based (Hyper Text Transfer Protocol). A TCP/IP protocol stack that means it is based on sophisticated and established standards manages the entire communication. Web server (HTTP server) and browser (HTTP client) build TCP/IP-applications. HTTP achieved a phenomenal distribution in the last years. Meanwhile millions of user around the world surf HTTP-based in the World Wide Web. Today almost every personal computer offers the necessary assistance for this protocol. This status is valid more and more for embedded systems also. The HTTP spreads up with a fast rate too. 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 8 The DIL/NetPCs DNP/1110 Using the Embedded Linux 1. TCP/IP-based HTTP as Communication Platform HTTP is a simple protocol that is based on a TCP/IP protocol stack (picture 1.A). HTTP uses TCP (Transmission Control Protocol). TCP is a relative complex and high-quality protocol to transfer data by the subordinate IP protocol. TCP itself always guarantees a safeguarded connection between two communication partners based on an extensive three-way-handshake procedure. As a result the data transfer via HTTP is always protected. Due to the extensive TCP protocol mechanisms HTTP offers only a low-grade performance. Figure 1: TCP/IP stack and HTTP programming model HTTP is based on a simple client/server-concept. HTTP server and client communicate via a TCP connection. As default TCP port value the port number 80 will be used. The server works completely passive. He waits for a request (order) of a client. This request normally refers to the transmition of specific HTML documents. This HTML documents possibly have to be generated dynamically by CGI. As result of the requests, the server will answer with a response that usually contains the desired HTML documents among others (picture 1.B). GET /test.htm HTTP/1.1 Accept: image/gif, image/jpeg, */* User selling agent: Mozilla/4.0 Host: Listing 1.A: HTTP GET-request HTTP/1.1 200 OK Date: Mon, 06 Dec 1999 20:55:12 GMT Server: Apache/1.3.6 (Linux) Content-length: 82 Content-type: text/html Test-Seite Test-Seite 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 9 The DIL/NetPCs DNP/1110 Using the Embedded Linux Listing 1.B: HTTP response as result of the GET-request from listing 1.A HTTP requests normally consist of several text lines, which are transmitted to the server by TCP. The listing 1.A shows an example. The first line characterizes the request type (GET), the requested object (/test1.htm) and the used HTTP version (HTTP/1.1). In the second request line the client tells the server, which kind of files it is able to evaluate. The third line includes information about the client- software. The fourth and last line of the request from listing 1.A is used to inform the server about the IP address of the client. In according to the type of request and the used client software there could follow some further lines. As an end of the request a blank line is expected. The HTTP responses as request answer mostly consist of two parts. At first there is a header of individual lines of text. Then follows a content object (optional). This content object maybe consists of some text lines in case of a HTML file or a binary file when a GIF or JPEG image should be transferred. The first line of the header is especially important. It works as status or error message. If an error occurs, only the header or a part of it will be transmitted as answer. 2. Functional principle of a Web Server Simplified a Web server can be imagined like a special kind of a file server. Picture 2.A shows an overview. The Web server receives a HTTP GET-request from the Web browser. By this request, a specific file is required as answer (see step 1 into picture 2.A). After that, the Web server tries to get access on the file system of the requested computer. Then it attempts to find the desired file (step 2). After the successful search the Web server read the entire file (step 3) and transmit it as an answer (HTTP response comprising of header and content object) to the Web browser (step 4). If the Web server cannot find the appropriate file in the file system, an error message (HTTP response which only contains the header) is simply be send as response to the client. Figure 2: Functional principle from Web server and browser 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 10 The DIL/NetPCs DNP/1110 Using the Embedded Linux The web content is build by individual files. The base is build by static files with HTML pages. Within such HTML files there are references to further files embedded these files are typically pictures in GIF or JPEG format. However, also references to other objects, for example Java-Applets, are possible. After a Web browser has received a HTML file of a Web server, this file will be evaluated and then searched for external references. Now the steps 1 to 4 from picture 2.A will run again fo r every external reference in order to request the respective file from the corresponding Web server. Please note, that such a reference consists of the name or IP address of a Web server (e.g. ), as well as the name of the desired file (e.g. picture1.gif). So virtually every reference can refer to another Web server. In other words, a HTML file could be located on the server ssv-embedded.de but the required picture -which is external referenced by this HTML file- is located on the Web server . Finally this (worldwide) networking of separate objects is the cause for the name World Wide Web (WWW). All files, which are required by a Web server, are requested from a browser like the procedure shown on picture 2.A. Normally these files are stored in the file system of the server. The Webmaster has to update these files from time to time. A further elementary functionality of a Web server is the Common Gateway Interface (CGI) -we have mentioned before. Originally this technology is made only for simple forms, which are embedded into HTML pages. The data, resulting from the padding of a form, will be transmitted to a Web server via HTTP-GET or POST-request (see step 1 into picture 2.B). In such a GET- or POST-request the name of the CGI program, which is needed for the evaluation of a form, is fundamentally included. This program has to be on the Web server. Normally the directory /cgi-bin is used as storage location. As result of the GET- or POST-request the Web server starts the CGI program located in the subdirectory /cgi-bin and delivers the received data in form of parameters (step 2). The outputs of a CGI program are guided to the Web server (step 3). Then the Web server sends them all as responses to the Web browser (step 4). 3. Dynamic generated HTML Pages In contradiction to a company Web site server, which informs people about the product program and services by static pages and pictures, an embedded Web server has to supply dynamically generated contents. The embedded Web server will generate the dynamic pages in the moment of the first access by a browser. How else could we check the actual temperature of a system via Internet? Static HTML files are not interesting for an embedded Web server. The most information about the firmware version and service instructions are stored in HTML format. All other tasks are normally made via dynamic generated HTML. There are two different technologies to generate a specific HTML page in the moment of the request: First the so-called server-side-scripting and second the CGI programming. At the server-side-scripting, script code is embedded into a HTML page. If required, this code will be carried out on the server (server-sided). 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 11 The DIL/NetPCs DNP/1110 Using the Embedded Linux For this, there are numerous script languages available. All these languages are usable inside a HTML-page. In the Linux community PHP is used mostly. The favourite of Microsoft is VBScript. It is also possible to insert Java directly into HTML pages. Sun has named this technology JSP (Java Server Pages). The HTML page with the script code is statically stored in the file system of the Web server. Before this server file is delivered to the client, a special program replaces the entire script code with dynamic generated standard HTML. The Web browser will not see anything from the script language. Figure 3: Single steps of the Server-Side-Scripting Picture 3 shows the single steps of the server-side-scripting. In step 1 the Web browser requests a specific HTML file via HTTP GET-request. The Web server recognizes the specific extension of the desired file (for example *.ASP or *.PHP instead of *.HTM and/or *.HTML) and starts a so-called scripting engine (see step 2). This program gets the desired HTML file including the script code from the file system (step 3), carry out the script code and make a new HTML file without script code (step 4). The included script code will be replaced by dynamic generated HTML. This new HTML file will be read by the Web server (step 5) and send to the Web browser (step 6). If a server-sided scripting is supposed to be used by an embedded Web server, so you have to consider the necessary additional resources. A simple example: In order to carry out the embedded PHP code into a HTML page, additional program modules are necessary for the server. A scripting engine together with the embedded Web server has to be stored in the Flash memory chip of an embedded system. Through that, during run time more main memory is required. 4. Web Server running under Linux Once spoken about Web servers in connection with Linux most people immediately think of Apache. After investigations of the Netcraft Survey this program is the mostly used Web server worldwide. Apache is an enhancement of the legendary NCSA server. The name Apache itself has nothing to do with Red Indians. It is a construct from A Patchy Server because the first version was put together from different code and patch files. Moreover there are numerous other Web servers - even for Linux. Most of this are standing under the GPL (like Apache) and can be used license free. A very extensive overview you can find at /. Every Web server has his advantages and disadvantages. Some are developed for specific functions and have very special qualities. Other distinguishes at best through their reaction rate at many simultaneous requests, as well as the variety of their 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 12 The DIL/NetPCs DNP/1110 Using the Embedded Linux configuration settings. Others are designed to need minimal resources and offer very small setting possibilities, as well as only one connection to a client. The most important thing by an embedded Web server is the actual resource requirements. Sometimes embedded systems offer only minimal resources, which mostly has to be shared with Linux. Meanwhile there are numerous high- performance 32-bit-386/486-microcontroller or (Strong)ARM-based embedded systems that own just 8 Mbytes RAM and 2 Mbytes Flash-ROM (picture 4). Outgoing from this ROM (Read-only-Memory, i.e. Flash memory chips) a complete Linux, based on a 2.2- or 2.4-Kernel with TCP/IP protocol stack and Web server, will be booted. HTML pages and programs are also stored in the ROM to generate the dynamic Web pages. The space requirements of an embedded system are similar to a little bigger stamp. There it is quite understandable that there is no place for a powerful Web server like Apache. Figure 4: Embedded Web Server Module with StrongARM and Linux But also the capability of an Apache is not needed to visualize the counter of a photocopier or the status of a percolator by Web servers and browsers. In most cases a single Web server is quite enough. Two of such representatives are boa () and thttpd (). At first, both Web servers are used in connection with embedded systems running under Linux. The configuration settings for boa and thttpd are poor, but quite enough. By the way, the source code is available to the customer. The practicable binary files for these servers are always smaller than 80 Kbytes and can be integrated in the most embedded systems without problems. For the dynamic generation of HTML pages both servers only offer CGI (Common Gateway Interface) as enlargement. Further technologies, like server-side-includes (SSI) are not available. The great difference between an embedded Web server and Apache is, next to the limited configuration settings, the maximal possible number of simultaneous requests. High performance servers like Apache immediately make an own process for every incoming call request of a client. Inside of this process all 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 13 The DIL/NetPCs DNP/1110 Using the Embedded Linux further steps will then be executed. This requires a very good programming and a lot of free memory resources during run time. But, on the other hand many Web browsers can access such a Web server simultaneously. Embedded Web server like boa and thttpd work only with one single process. If two users need to get access onto a embedded Web server simultaneously, one of both have to wait a few fractions of a second. But in the environment of the embedded systems that is absolutely justifiable. In this case it is first of all a question of remote maintenance, remote configuration and similar tasks. There are not many simultaneous requests expected. 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 14 The DIL/NetPCs DNP/1110 Using the Embedded Linux List of Figures Figure 1: TCP/IP stack and HTTP programming model Figure 2: Functional principle from Web server and browser Figure 3: Single steps of the Server-Side-Scripting Figure 4: Embedded Web Server Module with StrongARM and Linux Listings Listing 1.A: HTTP GET-request Listing 1.B: HTTP response as result of the GET-request from listing 1.A Contact SSV Embedded Systems Heisterbergallee 72 D-30453 Hannover Tel. +49-(0)511-40000-0 Fax. +49-(0)511-40000-40 Email: salesist1.de Web: www.ssv-embedded.de Document History (Sadnp05.Doc) Revisio n Date Name 1.00 24.05.2002 First Version KDW This document is meant only for the internal application. The contents of this document can change any time without announcement. There is taken over no guarantee for the accuracy of the statements. Copyright SSV EMBEDDED SYSTEMS 2002. All rights reserved. INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND. The user assumes the entire risk as to the accuracy and the use of this document. Some names within this document can be trademarks of their respective holders. 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 15 嵌入式系統(tǒng)的網(wǎng)絡(luò)服務(wù)器 在“每個(gè)人都處在互聯(lián)網(wǎng)的浪潮中”之后,現(xiàn)在很明顯隨之而來(lái)的是“每件事都處在互聯(lián)網(wǎng)的浪潮中”。大多數(shù)售賣(mài)咖啡的機(jī)器仍然不能提供全世界的聯(lián)網(wǎng)。然而嵌入式遠(yuǎn)程維護(hù)和診斷的網(wǎng)絡(luò)集成就像所謂的 M2M 通信一樣以一種相當(dāng)快的速度增長(zhǎng)。 對(duì)很多發(fā)展工程來(lái)說(shuō),僅僅是通過(guò)網(wǎng)絡(luò)瀏覽器經(jīng) Internet,或是經(jīng)過(guò)局域網(wǎng)進(jìn)行組成和系統(tǒng)的遠(yuǎn)程維護(hù)和診斷,負(fù)擔(dān)非常之重。在許多部門(mén)中,人們對(duì)于嵌入式系統(tǒng)配置和服務(wù)的工作完全地基于網(wǎng)絡(luò)。剩余的時(shí)間用前面的面板和一些功 能鍵組成一個(gè)小的 LC 顯示結(jié)束經(jīng)典用戶(hù)界面的制作。隨著移動(dòng)互聯(lián)網(wǎng)領(lǐng)域?qū)?lái)的發(fā)展,可以預(yù)期,基于藍(lán)牙技術(shù)的個(gè)人區(qū)域網(wǎng)和快速發(fā)展的M2M 通信會(huì)出現(xiàn)長(zhǎng)足的進(jìn)步。 經(jīng)過(guò)網(wǎng)絡(luò)瀏覽器獲得進(jìn)入一個(gè)嵌入式系統(tǒng)最主要的功能單元是網(wǎng)絡(luò)服務(wù)器。這種網(wǎng)絡(luò)服務(wù)器給網(wǎng)絡(luò)瀏覽器帶來(lái)全球互聯(lián)網(wǎng)或局域網(wǎng)上理想的 HTML 頁(yè)( HTML Hypertext Markup Language, 超文本鏈接標(biāo)示語(yǔ)言)和圖片。這樣發(fā)生了基于 HTTP( HTTP Hypertext Transfer Protocol, WWW 服務(wù)程序所用的協(xié)議)。一個(gè) TCP/IP 協(xié)議層,意味著基于這個(gè)已制定的標(biāo)準(zhǔn),來(lái)管理整個(gè)通信。網(wǎng)絡(luò)服務(wù)器( HTTP 服務(wù)器端)和瀏覽器( HTTP 客戶(hù)端)構(gòu)建了 TCP/IP 的應(yīng)用軟件。 HTTP 在去年達(dá)到了一個(gè)顯著的區(qū)分。其間全世界數(shù)以百萬(wàn)計(jì)的用戶(hù)在廣域網(wǎng)中使用基于 HTTP 進(jìn)行沖浪。今天幾乎每一臺(tái)個(gè)人電腦都對(duì)這個(gè)協(xié)議提供了必要的支持。這種狀況在嵌入式系統(tǒng)中也越來(lái)越多。 HTTP 在以極快的速度伸展。 1 基于 TCP/IP 的 HTTP 作為通信平臺(tái) HTTP 是一個(gè)基于 TCP/IP 協(xié)議層之上的簡(jiǎn)單的協(xié)議。 HTTP 使用 TCP( TCP Transfer Control Protocol, 傳輸控制協(xié)議)。 TCP 是一個(gè)通過(guò)下屬的 IP( IP Internet Protocol, 網(wǎng)際協(xié)議)協(xié)議傳輸數(shù)據(jù)的相對(duì)復(fù)雜和高質(zhì)量的協(xié)議。 TCP 本身經(jīng)過(guò)一個(gè)廣泛的三方握手程序,始終保證兩個(gè)通信伙伴之間安全的連接。因此經(jīng)過(guò) HTTP 的數(shù)據(jù)傳輸可以始終被保護(hù)。由于廣泛的 TCP 協(xié)議機(jī)制, HTTP 只表現(xiàn)出一種低級(jí)別的性能。 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 16 Figure 1: TCP/IP stack and HTTP programming model HTTP 基于一種簡(jiǎn)單的客戶(hù) /服務(wù)器的概念。 HTTP 服務(wù)器和客 戶(hù)端經(jīng)過(guò)一個(gè) TCP 連接進(jìn)行通信。默認(rèn)的端口號(hào)是 80。服務(wù)器完全被動(dòng)地工作。他等待客戶(hù)端的請(qǐng)求。這種請(qǐng)求通常指明確的HTML 文件的傳輸。這種 HTML 文件可能不得不由 CGI( CGI Common Gateway Interface , 公共網(wǎng)關(guān)接口)動(dòng)態(tài)產(chǎn)生。請(qǐng)求的結(jié)果,服務(wù)器通常將包含的需要的 HTML 文件通過(guò)響應(yīng)回答(Picture 1.B)。 HTTP 的請(qǐng)求通常由幾行文本組成,通過(guò) TCP 傳送到服務(wù)器。 Listing 1.A 給出了一個(gè)例子。第一行表明了請(qǐng)求類(lèi)型( GET),請(qǐng)求對(duì)象( /test1.htm)以及 使用 HTTP 的版本( HTTP/1.1)。請(qǐng)求的第二行客戶(hù)端告訴服務(wù)器能夠接收什么類(lèi)型的文件。第三行包括了關(guān)于客戶(hù)端軟件的信息。請(qǐng)求的第四行也是最后一行通知服務(wù)器客戶(hù)端的 IP 地址。依照請(qǐng)求的類(lèi)型以及應(yīng)用的客戶(hù)端軟件可以寫(xiě)出更多行??梢杂靡粋€(gè)空行作為請(qǐng)求的結(jié)尾。 GET /test.htm HTTP/1.1 Accept: image/gif, image/jpeg, */* User selling agent: Mozilla/4.0 Host: Listing 1.A: HTTP GET-request HTTP/1.1 200 OK Date: Mon, 06 Dec 1999 20:55:12 GMT Server: Apache/1.3.6 (Linux) Content-length: 82 Content-type: text/html Test-Seite Test-Seite Listing 1.B: HTTP response as result of the GET-request from listing 1.A 作為對(duì) HTTP 請(qǐng)求的回答主要由兩部分組成。首先有一個(gè)個(gè)別文本行的標(biāo)題。跟著又一個(gè)內(nèi)容對(duì)象(可選擇)。這個(gè)內(nèi)容對(duì)象大概由一些文本行組成,假設(shè)是一個(gè) HTML 文件或者二進(jìn)制文件,這時(shí)候可以傳送 GIF 或 JPEG 格式的圖像。標(biāo)題的第一行特別重要。它起著報(bào)告狀態(tài)和錯(cuò)誤信息的作用。如果發(fā)生錯(cuò)誤,只傳送標(biāo)題或標(biāo)題的一部分作為回答。 北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 17 2 網(wǎng)絡(luò)服務(wù)器的功能原理 簡(jiǎn)單化一個(gè)網(wǎng)絡(luò)服務(wù)器可以被設(shè)想成像一個(gè)特殊類(lèi)型的文件服務(wù)器。 Picture 2.A 展示出了總體結(jié)構(gòu)。網(wǎng)絡(luò)服務(wù)器從網(wǎng)絡(luò)瀏覽器接收了一個(gè) HTTP 的 GET 請(qǐng)求。通過(guò)這個(gè)請(qǐng)求,必須有一個(gè)明確的文件作為回答(見(jiàn) Picture 2.A 中的 Step1)。之后,網(wǎng)絡(luò)服務(wù)器嘗試進(jìn)入被請(qǐng)求電腦的文件系統(tǒng)。然后嘗試找到一個(gè)需要的文件( Step2)。在成功搜尋之后,網(wǎng)絡(luò)服務(wù)器讀取整個(gè)文件( Step3),作為一個(gè)回答傳送回網(wǎng)絡(luò)瀏覽器( HTTP 響應(yīng)由標(biāo)題和內(nèi)容對(duì)象組成)。如果網(wǎng)絡(luò)服務(wù)器不能在文件系統(tǒng)中找到合適的文件,一個(gè)錯(cuò)誤信息(只包含標(biāo)題的 HTTP 響應(yīng))簡(jiǎn)單地作為響應(yīng)發(fā)送到客戶(hù)端。 Figure 2: Functional principle from Web server and browser 網(wǎng)絡(luò)的內(nèi)容由單獨(dú)的文件構(gòu)建。它的基礎(chǔ)是用 HTML 頁(yè)的靜態(tài)文件構(gòu)建的。在這些 HTML 文件里涉及到遠(yuǎn)程文件的嵌入。這些文件是 GIF 或 JPEG 格式的這些有代表性地圖片。然而也涉及到其它一些對(duì)象,例如可能有 JAVA 程序。在網(wǎng)絡(luò)瀏覽器接收到網(wǎng)絡(luò)服務(wù)器的 HTML 文件之后,這個(gè)文件將被評(píng)價(jià)然后為外部參考搜索?,F(xiàn)在 Picture 2.A 的 1 4 步將為每一個(gè)外部參考再一次運(yùn)行,為了從相應(yīng)的網(wǎng)絡(luò)服務(wù)器中請(qǐng)求各自的文件。請(qǐng)注意,這 樣一個(gè)參考由網(wǎng)絡(luò)服務(wù)器的名字或IP 地址組成(例如“ ”),需要文件的名字也是如此(例如“ picture1.gif”)。所以事實(shí)上每一個(gè)參考都能夠查閱另一個(gè)服務(wù)器。換句話說(shuō),一個(gè) HTML 文件能夠定位在服務(wù)器“ ssv embedded.de”上,但通過(guò)這個(gè) HTML 文件外部涉及到的需要的圖像定位在網(wǎng)絡(luò)服務(wù)器“ ”上。最后這個(gè)分離對(duì)象的網(wǎng)絡(luò)是萬(wàn)維網(wǎng)( WWW)得名的原因。所有通過(guò)網(wǎng)絡(luò)服務(wù)器的必須得文件被瀏覽器請(qǐng)求,就像 Picture 2.A 中展示的那樣。通常這些文件被存儲(chǔ)在 網(wǎng)絡(luò)服務(wù)器的文件系統(tǒng)中,網(wǎng)絡(luò)管理員有時(shí)會(huì)更新它們。 網(wǎng)絡(luò)服務(wù)器更進(jìn)一步的基本功能是我們前面提到的公共網(wǎng)關(guān)接口( CGI Common Gateway Interface , 公共網(wǎng)關(guān)接口)。最初這項(xiàng)技術(shù)只應(yīng)用于簡(jiǎn)單的嵌入 HTML 頁(yè)的窗體。作為窗體填料結(jié)果的數(shù)據(jù)將經(jīng) HTTP GET 或 POST request 被傳送到網(wǎng)絡(luò)服務(wù)器(見(jiàn) Picture 2.B 的 Step1)。在這樣一個(gè) GET或 POST的請(qǐng)求中, CGI 需要被窗體賦值的程序名已經(jīng)被包括進(jìn)去。這個(gè)程序需要放在網(wǎng)絡(luò)服務(wù)器上。通常存儲(chǔ)在“ /cgi bin”目 錄中。 GET或 POST請(qǐng)求的結(jié)果是網(wǎng)絡(luò)服務(wù)器啟動(dòng)位于“ /cgi bin”目錄中的 CGI 程序,根據(jù)參數(shù)傳遞標(biāo)準(zhǔn)的數(shù)據(jù)( Step2)。一個(gè) CGI 程序的輸出導(dǎo)向到網(wǎng)絡(luò)服務(wù)器( Step3)。然后網(wǎng)絡(luò)服務(wù)器把數(shù)據(jù)全部傳送到網(wǎng)絡(luò)瀏覽器作為響應(yīng)( Step4)。 3 動(dòng)態(tài)產(chǎn)生 HTML 頁(yè) 與一個(gè)公司通過(guò)靜態(tài)頁(yè)面和圖片告訴人們有關(guān)產(chǎn)品計(jì)劃和服務(wù)的網(wǎng)頁(yè)相反,一個(gè)嵌入式的網(wǎng)北京工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(譯文) 18 絡(luò)服務(wù)器能夠提供動(dòng)態(tài)產(chǎn)生的內(nèi)容。它將在首先通過(guò)瀏覽器進(jìn)入的時(shí)候產(chǎn)生動(dòng)態(tài)頁(yè)面。如何另外通過(guò) Internet 檢查系統(tǒng)的實(shí)際溫度?靜態(tài) HTML 文件對(duì)一個(gè)嵌入式 的網(wǎng)絡(luò)服務(wù)器來(lái)說(shuō)沒(méi)有什么意思。最多關(guān)于固件的版本和服務(wù)的信息是通過(guò) HTML 格式存儲(chǔ)的。另外所有其它的任務(wù)通常都是由動(dòng)態(tài)產(chǎn)生 HTML 完成的。 在請(qǐng)求的時(shí)刻有兩種產(chǎn)生 HTML 頁(yè)的不同技術(shù):第一種是所謂的服務(wù)器方腳本,第二種是 CGI設(shè)計(jì)。在服務(wù)器方腳本中,腳本代碼嵌入到 HTML 頁(yè)中。如果需要,這些代碼將在服務(wù)器方被執(zhí)行。 因此,有許多種可以提供的腳本語(yǔ)言,這些語(yǔ)言在 HTML 頁(yè)中都可用。在 Linux 團(tuán)體中主要使用 PHP( PHP:一種新型的 CGI 網(wǎng)絡(luò)程序編寫(xiě)語(yǔ)言。)。微軟中意的是 VBScript。在 HTML 頁(yè)中插入 JAVA 同樣可能。美國(guó)的 Sun 公司將這種技術(shù)命名為 JSP。用腳本代碼編寫(xiě)的網(wǎng)頁(yè)靜態(tài)地存儲(chǔ)在網(wǎng)絡(luò)服務(wù)器的文件系統(tǒng)之中。在服務(wù)器的文件被傳送到客戶(hù)端之前,一段特殊的程序用

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論