您的位置:首页 > 产品设计 > UI/UE

December 4th Tuesday (十二月 四日 火曜日)

2008-01-07 20:01 435 查看
  The hooks in an Apache module is a way to influence or take charge of some aspect of processing.

  'post_read_request' This is the first hook available to modules in normal request processing.  It is available
to modules that need to hook very early into processing a request.

  'translate_name' Apache maps the request URL to the filesystem.  A module can insert a hook here to substitute
its own logic -- for example, mod_alias.

  'map_to_storage' Since the URL has been mapped to the filesystem, we are now in a position to apply per-directory
configuration.  It can enables Apache to determine the configuration options that apply to this request. It applies
normal configuration directives for all active modules, so few modules should ever need to apply hooks here.

  'header_parser' This hook inspects the request headers.  It is rarely used, as modules perform that task at any point
in the request processing, and they usually do so within the context of another hook.

  'access_checker' Apache checks whether access to the requested resource is permitted according to the server configuration.
A module can add to or replace Apache's standard logic, which implements the Allow/Deny From directives in mod_access or
mod_authz_host.

  'check_user_id' If any authentication method is in use, Apache will apply the relevant authentication and set the username
field r->user.  A module may implement an authentication method with this hook.

  'auth_checker' This hook checks whether the requested operation is permitted to the authenticated user.

  'type_checker' This hook applies rules related to the MIME type of the requested resource, and determines the content handler
to use.

  'fixups' This general-purpose hook enables modules to run any necessary processing after the preceding hooks but before
the content generator.

  'handler' This is the content generator hook.  It is responsible for sending an appropriate response to the client.  If there
are input data, the handler is also responsible for reading them.  Unlike the otehr hooks, where zero or many functions may be
involved in processing a request, every request is processed by exactly one handler.

  'log_transaction' This hook logs the transaction after the response has been returned to the client.  A module may modify or
replace Apache's standard logging.

  The general-purpose of every webserver is request processing phases (metadata -> generator -> logger), which is common. 
The order of processing centers on the content generator, which is responsible for pulling data from the input filter stack
and pushing data onto the putput filters.

  Which hooks we need to create depend on which part or parts of the request our module is interested in.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息