当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Apache API notes

Unix/Linux
Linux crontab定时执行任务 命令格式与详细例子
linux 查看用户及用户组的方法
让Linux系统有效防御ARP攻击的实用技巧
Linux 常用软件列表
linux wget 一个强大的下载命令
linux 常用脚本、命令
linux 磁盘配额 简单介绍
Linux服务器架设笔记 Squid服务器配置
ubuntu intel 集成显卡安装
ubuntu 9.04 X3100 显卡开启3D特效
Ubuntu 8.10 Server Ruby 的安装方法
Ubuntu root帐户密码修改
ubuntu下apt-get 命令参数
Ubuntu Linux下实现QQ的三种方式
Ubuntu 8.04中建立PHP+MySQL环境
Ubuntu常用软件大全
Ubuntu系统下安装Aircrack-ng
Ubuntu实现FTP功能
ubuntu 字体美化实现方法
ubuntu下netbeans汉字显示残缺问题

Unix/Linux 中的 Apache API notes


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 85 ::
收藏到网摘: n/a

本文来自apache网站的同名文章,其作者为 Robert S. Thau只是粗略的浏览并简单的翻译,欢迎大家提出意见,我会改正。我不对译文的正确性做任何保证,我放在这里仅仅是因为我自己可以方便的查阅到这篇文章These are some notes on the Apache API and the data structures you haveto deal with, etc. They are not yet nearly complete, but hopefully,they will help you get your bearings. Keep in mind that the API isstill subject to change as we gain experience with it. (See the TODOfile for what might be coming). However, it will be easy to adaptmodules to any changes that are made. (We have more modules to adaptthan you do).这里有一些你需要注意的,关于ApacheAPI和数据结构的注意事项。它们还没有完成,但是幸运的是,它们将有助于你确定你的方向。需要始终牢记在心的是,API永远可能会被修改,我们也始终能从中得到新的体验。(可以参阅TODO文件,看看会有哪些改变)。但是,这些改变会轻松的兼容更有的模块
A few notes on general pedagogical style here. In the interest ofconciseness, all structure declarations here are incomplete --- thereal ones have more slots, that I'm not telling you about. For the mostpart, these are reserved to one component of the server core oranother, and should be altered by modules with caution. However, insome cases, they really are things I just haven't gotten around to yet.Welcome to the bleeding edge.Finally, here's an outline, to give you some bare idea of what's coming up, and in what order: * Basic concepts. o Handlers, Modules, and Requests o A brief tour of a module * How handlers work o A brief tour of the request_rec o Where request_rec structures come from o Handling requests, declining, and returning error codes o Special considerations for response handlers o Special considerations for authentication handlers o Special considerations for logging handlers * Resource allocation and resource pools * Configuration, commands and the like o Per-directory configuration structures o Command handling o Side notes --- per-server configuration, virtual servers, etc. Basic concepts.We begin with an overview of the basic concepts behind the API, and how they are manifested in the code.Handlers, Modules, and RequestsApache breaks down request handling into a series of steps, more orless the same way the Netscape Server API does (although this API has afew more stages than NetSite does, as hooks for stuff I thought mightbe useful in the future). These are: * URI -> Filename translation * Auth ID checking [is the user who they say they are?] * Auth access checking [is the user authorized here?] * Access checking other than auth * Determining MIME type of the object requested * "Fixups" --- there aren't any of these yet, but the phase isintended as a hook for possible extensions like SetEnv, which don'treally fit well elsewhere. * Actually sending a response back to the client. * Logging the request These phases are handled by looking at each of a succession of modules,looking to see if each of them has a handler for the phase, andattempting invoking it if so. The handler can typically do one of threethings: * Handle the request, and indicate that it has done so by returning the magic constant OK. * Decline to handle the request, by returning the magic integerconstant DECLINED. In this case, the server behaves in all respects asif the handler simply hadn't been there. * Signal an error, by returning one of the HTTP error codes. Thisterminates normal handling of the request, although an ErrorDocumentmay be invoked to try to mop up, and it will be logged in any case. Most phases are terminated by the first module that handles them;however, for logging, "fixups", and non-access authentication checking,all handlers always run (barring an error). Also, the response phase isunique in that modules may declare multiple handlers for it, via adispatch table keyed on the MIME type of the requested object. Modulesmay declare a response-phase handler which can handle any request, bygiving it the key */* (i.e., a wildcard MIME type specification).However, wildcard handlers are only invoked if the server has alreadytried and fail