简易Web服务器的设计与实现
摘 要
步入信息时代Web的广泛应用,是大家有目共睹的。Web是一种典型的分布式应用架构。Web应用中的每一次信息交换都要涉及到客户端和服务端两个层面。因此,Web开发技术大体上也可以被分为客户端技术和服务端技术两大类。Web客户端的主要任务是展现信息内容,主要包括:HTML、Java Applets、脚本程序、CSS、插件技术以及VRML技术,从早期的HTML到VRML,Web已经由静态逐步进入动态,将用户带入一个五彩缤纷的虚拟世界;与此同时服务器端的开发技术也是在由静态向动态逐步发展、完善起来,先后出现了CGI、PHP、ASP、.NET、Servlet和JSP等技术。
在这样的背景下,本毕业设计《Web服务器的设计与实现》基于http协议来完成Web服务器程序设计,服务器可以实现简单的用户配置、静态网页响应功能。服务器通过运用多线程实现并发来支持多用户访问,并能通过配置来实现控制:监听端口、最大并发访问客户端数目、Web网页根目录、CGI根目录、默认访问文件名、客户端空闲链接超时时间等。将按照先定义需求,明确需求定义;再对需求进行分析,明确实现的方式和关键,进行模块设计;接着按照模块设计,进行编码;最后进行编译和测试的步骤来论文。【关键字】:web;cgi;linux;http
The design and implementation of a Web server
Abstract
As we kown , In the information age, Web application, is everyone is obvious. The Web is a kind of typical distributed application architecture. Web application every information exchange will involve the client and the server two levels. Therefore, Web development technology in general can also be divided into client technology and the server technology two kinds big. Web client main task is to show information content, mainly including: the HTML, Java Applets, scripts, CSS, plug-in technology and VRML technologies, from early HTML to VRML, by static Web has gradually entered the dynamic, will the user into a colourful virtual world; Meanwhile server-side developer technology is in the static to dynamic gradually developed, perfecting the rise, successively appeared CGI, PHP, ASP,.net, Servlet and JSP techniques.
Under this circumstance, the graduation design "simple Web server is the design and implementation of the Linux environment, build a simple Web server, the program based on the HTTP protocol to complete Web server program design, the server can achieve simple user configuration, static Web response function. Server using multithreading realize concurrent to support many users access to function, and can through changing the configuration file or directly in the command line set corresponding properties, to realize control: listening socket, ma