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

  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.

 

你可能感兴趣的:(December 4th Tuesday (十二月 四日 火曜日))