⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 new_features_2_2.html

📁 这个是我在web培训时老师提供的手册
💻 HTML
字号:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="Apache, 中文, 手册, 中文版, 中文手册, 中文版手册, 参考手册, 中文参考手册, 金步国" />
<meta name="description" content="Apache 2.2 中文版参考手册" />
<meta name="author" content="金步国" />
<link href="./style/css/manual-zip.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="./style/css/manual-zip-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<title>Apache 2.2 新特性概述 - Apache 2.2 中文版参考手册</title>
</head>
<body id="manual-page">
<div id="page-header"><p class="menu"><a href="./mod/index.html">模块索引</a> | <a href="./mod/directives.html">指令索引</a> | <a href="./faq/index.html">常见问题</a> | <a href="./glossary.html">词汇表</a> | <a href="./sitemap.html">站点导航</a></p><p class="apache">Apache HTTP Server 版本2.2</p><img alt="" src="./images/feather.gif" /></div>
<div class="up"><a href="./index.html"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
<div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="./index.html">版本2.2</a></div>

<div id="translation-info">   <a href="./translator_announcement.html#thanks">致谢</a> | <a href="./translator_announcement.html#announcement">译者声明</a> | 本篇译者:<a href="mailto:&#099;sfr&#0097;nk&#0064;&#099;itiz&#046;n&#0101;t">金步国</a> | 本篇译稿最后更新:2006年1月5日 | <a href="./translator_announcement.html#last_new">获取最新版本</a></div>
<div id="page-content"><div id="preamble"><h1>Apache 2.2 新特性概述</h1>


  <p>这篇文档简述了Apache HTTP Server 2.0和2.2 版本之间的主要差异。对于1.3版本以后的新特性,请参考<a href="new_features_2_0.html">Apache 2.0 新特性</a>文档。</p>
</div>
	<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="core" id="core">核心增强</a></h2>
    
    <dl>

      <dt>认证/授权(Authn/Authz)</dt>
      <dd>原本捆绑在一起的认证(authentication)与授权(authorization)模块现在被分开了。新的<code class="module"><a href="./mod/mod_authn_alias.html">mod_authn_alias</a></code>模块可以极大的简化某些身份认证的配置。请参见<a href="#module">模块名的变更</a>和<a href="#developer">针对模块开发者的变更</a>以了解更多有关这些变更对于模块使用者和模块开发者的影响。</dd>

      <dt>缓冲</dt>
      <dd><code class="module"><a href="./mod/mod_cache.html">mod_cache</a></code>、<code class="module"><a href="./mod/mod_disk_cache.html">mod_disk_cache</a></code>、<code class="module"><a href="./mod/mod_mem_cache.html">mod_mem_cache</a></code>经历了诸多修改以后现在已经具备了合格的产品质量了。新增加的<code class="program"><a href="./programs/htcacheclean.html">htcacheclean</a></code>工具可以用来清理<code class="module"><a href="./mod/mod_disk_cache.html">mod_disk_cache</a></code>模块使用的缓冲存储区。</dd>

      <dt>配置</dt>
      <dd>默认的配置布局已经被简化并模块化了。启用常用特性的配置片段现在已经和Apache捆绑在一起,可以被轻易的添加到主配置文件中。</dd>

      <dt>优雅停止(Graceful stop)</dt>
      <dd><code class="module"><a href="./mod/prefork.html">prefork</a></code>、<code class="module"><a href="./mod/worker.html">worker</a></code>、<code class="module"><a href="./mod/event.html">event</a></code>多路处理模块(MPM)现在允许<code class="program"><a href="./programs/httpd.html">httpd</a></code>通过<a href="stopping.html#gracefulstop"><code>graceful-stop</code></a>信号被优雅的停止。可以用新增的<code class="directive"><a href="./mod/mpm_common.html#gracefulshutdowntimeout">GracefulShutdownTimeout</a></code>指令指定一个超时时间,超过指定的时间以后<code class="program"><a href="./programs/httpd.html">httpd</a></code>将会强行中止,而无论请求所处的服务状态如何。</dd>

      <dt>代理</dt>
      <dd>新增的<code class="module"><a href="./mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>模块为<code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>提供了负载均衡服务。新增的<code class="module"><a href="./mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code>模块为<a href="http://jakarta.apache.org/tomcat/">Apache Tomcat</a>使用的<code>Apache JServ Protocol version 1.3</code>提供了支持。</dd>

      <dt>正则表达式库更新</dt>
      <dd>5.0版的<a href="http://www.pcre.org/">Perl兼容正则表达式库</a>(PCRE)已经被包含进来了。<code class="program"><a href="./programs/httpd.html">httpd</a></code>现在可以通过 <code>--with-pcre</code> 编译选项使用系统中已经安装好的PCRE。</dd>

      <dt>智能过滤器</dt>
      <dd><code class="module"><a href="./mod/mod_filter.html">mod_filter</a></code>可以进行输出过滤器链的动态配置。它允许过滤器按照请求头或应答头或环境变量有条件的插入,这样就避免了许多在Apache2.0体系结构中存在的过滤器之间的依赖性和顺序问题。</dd>

      <dt>大文件支持</dt>

      <dd>httpd现在已经被构建为在现代的32位Unix系统上支持大于2GB的文件。而且也可以处理大于2G的请求体(request body)。</dd>

      <dt>Event MPM</dt>
      <dd><code class="module"><a href="./mod/event.html">event</a></code>多路处理模块(MPM)使用一个单独隔开的线程处理持久连接(Keep Alive)。传统上,持久连接要求httpd专门拿出一个工作者(worker)(也就是一个进程/线程)来处理它。这个专用的工作者在持久连接超时前不能被重新使用。</dd>

      <dt>SQL数据库支持</dt>
      <dd><p><code class="module"><a href="./mod/mod_dbd.html">mod_dbd</a></code>和apr_dbd框架(framework)一起为需要使用数据库的模块提供直接的支持。在线程化的MPM中还能支持连接缓冲池。</p>
	  <p><strong>Windows用户</strong>请注意,这个特性尚未包含在标准的windows版Apache中。如果你尝试在Windows平台上使用这个特性,请告诉我们你的进展情况。</p>
	  </dd>

    </dl>
  </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="module" id="module">模块增强</a></h2>
    
    <dl>
      <dt>认证/授权(Authn/Authz)</dt>
      <dd>aaa目录下的模块已经被重新命名并提供了对摘要认证(digest authentication)的更好支持。例如,mod_auth现在已经被分割成<code class="module"><a href="./mod/mod_auth_basic.html">mod_auth_basic</a></code>和<code class="module"><a href="./mod/mod_authn_file.html">mod_authn_file</a></code>两个模块;mod_auth_dbm现在更名为<code class="module"><a href="./mod/mod_authn_dbm.html">mod_authn_dbm</a></code>;mod_access现在更名为<code class="module"><a href="./mod/mod_authz_host.html">mod_authz_host</a></code>;还新增了一个<code class="module"><a href="./mod/mod_authn_alias.html">mod_authn_alias</a></code>模块用于简化某些认证配置。</dd>

      <dt><code class="module"><a href="./mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code></dt>
      <dd>这个模块是2.0版<code>mod_auth_ldap</code>模块到2.2版的<code>Authn/Authz</code>框架的一个移植。新的特性包括使用LDAP属性值和<code class="directive"><a href="./mod/core.html#require">Require</a></code>指令中复杂的搜索过滤器。</dd>

      <dt><code class="module"><a href="./mod/mod_info.html">mod_info</a></code></dt>
      <dd>添加了一个新的 <code>?config</code> 参数,可以用来显示被Apache分析过的配置指令,包括它们的文件名和行号。该模块还显示所有请求钩子(request hook)的顺序和额外的编译信息,有些类似于 <code>httpd -V</code></dd> 

      <dt><code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code></dt>
      
      <dd>添加了<a href="http://www.ietf.org/rfc/rfc2817.txt">RFC 2817</a>支持,它允许连接从明文提升到TLS加密。</dd>

      <dt><code class="module"><a href="./mod/mod_imagemap.html">mod_imagemap</a></code></dt>
      <dd>mod_imap已经被重命名为<code class="module"><a href="./mod/mod_imagemap.html">mod_imagemap</a></code>,以避免用户产生混淆和疑惑。</dd>
    </dl>

  </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="programs" id="programs">程序增强</a></h2>
    
    <dl>
      <dt><code class="program"><a href="./programs/httpd.html">httpd</a></code></dt>
      <dd>添加了一个新的命令行选项 <code>-M</code> 用来列出基于当前配置加载的所有模块。不同于 <code>-l</code> 选项的是,它还列出了通过<code class="module"><a href="./mod/mod_so.html">mod_so</a></code>加载的DSO(动态共享对象)。</dd>
      <dt><code class="program"><a href="./programs/httxt2dbm.html">httxt2dbm</a></code></dt>
      <dd>一个用于从文本输入产生dbm文件的程序,目的是为了能够在<code class="directive"><a href="./mod/mod_rewrite.html#rewritemap">RewriteMap</a></code>中使用<code>dbm</code>映射表(map)类型。</dd>
    </dl>
  </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="developer" id="developer">针对模块开发者的变化</a></h2>
    
    <dl>
      <dt><a class="glossarylink" href="./glossary.html#apr" title="see glossary">APR</a> 1.0 API</dt>

      <dd>Apache2.2 使用 APR 1.0 API 。所有反对使用的函数和符号已经从 <code>APR</code> 和 <code>APR-Util</code> 中清除掉了。欲知详情,请查看<a href="http://apr.apache.org/">APR 网站</a>。</dd>

      <dt>认证/授权(Authn/Authz)</dt>
      <dd>原来捆绑在一起的认证和授权模块已经被按照下列规则进行了重命名:
          <ul>
          <li>mod_auth_* &nbsp;&nbsp;&nbsp;-&gt; 实现HTTP认证机制的模块</li>
          <li>mod_authn_* &nbsp;-&gt; 实现后端认证支持者的模块</li>
          <li>mod_authz_* &nbsp;&nbsp;-&gt; 实现授权(或访问)的模块</li>
          <li>mod_authnz_*&nbsp;-&gt; 同时实现认证和授权的模块</li>
          </ul>
          现在有一个新的认证后端提供者方案,可以简化新认证后端的创建。</dd>

      <dt>连接错误日志</dt>

      <dd>添加了一个新的<code>ap_log_cerror</code>函数用于记录客户端连接时发生的错误。并且在记录时包含客户端IP地址。</dd>

      <dt>添加了一个测试配置的钩子(hook)</dt>

      <dd>添加了一个新的<code>test_config</code> 钩子,可以在用户向<code class="program"><a href="./programs/httpd.html">httpd</a></code>传递 <code>-t</code> 选项时,执行包含特定代码的模块。</dd>

      <dt>设置线程型MPM所使用的栈空间大小</dt>

      <dd>新增的<code>ThreadStackSize</code>指令可以用来限制所有线程型MPM所使用的栈大小。一些默认栈空间较小的平台上的第三方模块需要使用它指定栈空间的大小。</dd>

      <dt>输出过滤器协议处理</dt>

      <dd>过去,每个过滤器都要确保自身能够产生正确的应答头。现在过滤器可以调用<code>ap_register_output_filter_protocol</code>或<code>ap_filter_protocol</code>来委托<code class="module"><a href="./mod/mod_filter.html">mod_filter</a></code>进行协议管理。</dd>

      <dt>添加了监视钩子(Monitor hook)</dt>
      <dd>监视钩子可以让模块运行父进程中事先安排好的工作。</dd>
          
      <dt>正则表达式 API 发生了变化</dt>

      <dd><code>pcreposix.h</code>头文件现在被<code>ap_regex.h</code>头文件取代了。原来老的POSIX.2 <code>regex.h</code> 实现现在位于<code>ap_</code>名字空间下(由<code>ap_regex.h</code>提供)。比如原来的<code>regcomp</code>, <code>regexec</code>调用现在要修改成<code>ap_regcomp</code>, <code>ap_regcomp</code>调用。</dd>

      <dt>DBD框架(SQL数据库API)</dt>

      <dd><p>在1.x和2.0版本中,需要SQL支持的模块必须自己管理数据库。为了不要重新发明轮子,Apache 2.1 及以后的版本提供了<code>ap_dbd</code> API 来管理数据库连接(包括对线程型和非线程型MPM进行优化),同时 APR 1.2 及以后版本也提供了<code>apr_dbd</code> API 与数据库打交道。</p>
      <p>新模块<strong>应当</strong>使用了这些API来进行数据库操作。现存的应用程序<strong>应当</strong>进行透明的升级或使用推荐选项来使用这些API。</p></dd>
    </dl>
  </div></div>
<div id="footer">
<p class="apache">本文允许自由使用、分发、转载,但必须保留译者署名;详见:<a href="./translator_announcement.html#announcement">译者声明</a>。</p>
<p class="menu"><a href="./mod/index.html">模块索引</a> | <a href="./mod/directives.html">指令索引</a> | <a href="./faq/index.html">常见问题</a> | <a href="./glossary.html">词汇表</a> | <a href="./sitemap.html">站点导航</a></p></div>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -