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

📄 mod_info.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>mod_info - Apache 2.2 中文版参考手册</title>
</head>
<body><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> &gt; <a href="./index.html">模块</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月26日 | <a href="../translator_announcement.html#last_new">获取最新版本</a></div>
<div id="page-content"><div id="preamble"><h1>Apache模块 mod_info</h1>

<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="module">
<tr><th><a href="module-dict.html#Description">说明</a></th><td>生成Apache配置情况的Web页面</td></tr>
<tr><th><a href="module-dict.html#Status">状态</a></th><td>扩展(E)</td></tr>
<tr><th><a href="module-dict.html#ModuleIdentifier">模块名</a></th><td>info_module</td></tr>
<tr><th><a href="module-dict.html#SourceFile">源文件</a></th><td>mod_info.c</td></tr>
</table>
<h3>概述</h3>

    <p>要配置<code class="module"><a href="../mod/mod_info.html">mod_info</a></code>请将下列内容加入<code>httpd.conf</code>文件。</p>

    <div class="example"><p><code>
      &lt;Location /server-info&gt;<br />
      <span class="indent">
        SetHandler server-info<br />
      </span>
      &lt;/Location&gt;
    </code></p></div>

    <p>你可能希望在<code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>指令中使用<code class="module"><a href="../mod/mod_access.html">mod_access</a></code>来限制对服务器配置信息的访问:</p>

    <div class="example"><p><code>
      &lt;Location /server-info&gt;<br />
      <span class="indent">
        SetHandler server-info<br />
        Order deny,allow<br />
        Deny from all<br />
        Allow from yourcompany.com<br />
      </span>
      &lt;/Location&gt;
    </code></p></div>

    <p>一旦配置完成,你的服务器信息就可以通过访问<code>http://your.host.example.com/server-info</code>得到。</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="security" id="security">安全问题</a></h2>
    <p>一旦<code class="module"><a href="../mod/mod_info.html">mod_info</a></code>被加载,它的处理能力就在<em>所有</em>配置文件中生效,包括<code>.htaccess</code>文件。这可能给网站带来安全问题。</p>

    <p>特别的,该模块还会泄漏许多配置信息,比如:系统路径、用户名/密码、数据库名称等等。而且根据此模块的工作方式,无法对它产生的信息进行屏蔽。因此,应当<strong>仅仅在受控环境下</strong>使用该模块,并且始终保持警惕。</p>

    <p>你可以使用<code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>来限制对这些敏感信息的访问:</p>
      
    <div class="example"><h3>访问控制</h3><p><code>
      &lt;Location /server-info&gt;<br />
      <span class="indent">
        SetHandler server-info<br />
        Order allow,deny<br />
        # 允许本机自身访问<br />
        Allow from 127.0.0.1<br />
        # 还允许局域网内的另外一台机器访问<br />
        Allow from 192.168.1.17<br />
      </span>
      &lt;/Location&gt;
    </code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="queries" id="queries">选择哪些信息可以被显示</a></h2>
    <p>默认情况下显示的信息:所有启用的模块、每个模块的指令说明、每个模块的钩子、当前配置信息。</p>
    
    <p>还可以通过在<code>server-info</code>后面加上请求字符串来查看特定的信息。比如 <code>http://your.host.example.com/server-info?config</code> 将显示所有配置指令。</p>
    
    <dl>
        <dt><code>?&lt;module-name&gt;</code></dt>
            <dd>仅显示与该模块相关的信息</dd>
        <dt><code>?config</code></dt>
            <dd>仅显示所有配置指令,不按模块分类</dd>
        <dt><code>?hooks</code></dt>
            <dd>仅显示每个模块所属钩子(Hook)列表</dd>
        <dt><code>?list</code></dt>
            <dd>仅显示所有启用的模块列表</dd>
        <dt><code>?server</code></dt>
            <dd>仅显示基本的服务器信息</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="limitations" id="limitations">已知的局限</a></h2>
    <p>由于<code class="module"><a href="../mod/mod_info.html">mod_info</a></code>提供的信息是根据已经解析过配置树提供的,而不是原始的配置文件,因此有以下局限:</p>
    <ul>
      <li>立即执行而并不存储的指令不会被列出。包括:<code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>, <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>, <code class="directive"><a href="../mod/mod_so.html#loadfile">LoadFile</a></code> 。</li>
      <li>控制配置文件自身行为的指令不会被列出,包括:<code class="directive"><a href="../mod/core.html#include">Include</a></code>, <code class="directive"><a href="../mod/core.html#&lt;ifmodule&gt;">&lt;IfModule&gt;</a></code>, <code class="directive"><a href="../mod/core.html#&lt;ifdefine&gt;">&lt;IfDefine&gt;</a></code>  。但是通过<code class="directive"><a href="../mod/core.html#include">Include</a></code>包含进来的指令将会被列出。</li>
      <li>配置中的注释不会被列出。</li>
      <li><code>.htaccess</code>文件中的配置指令不会被列出。</li>
      <li>容器中的指令按原样列出,但是<code class="module"><a href="../mod/mod_info.html">mod_info</a></code>不会计算<code class="directive"><a href="../mod/core.html#&lt;/directory&gt;">&lt;/Directory&gt;</a></code>容器中的行号。</li>
      <li>第三方模块(如<code class="module"><a href="../mod/mod_perl.html">mod_perl</a></code>)的指令有可能不会被列出。</li>
    </ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddModuleInfo" id="AddModuleInfo">AddModuleInfo</a> <a name="addmoduleinfo" id="addmoduleinfo">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>为server-info处理器显示的模块增加额外信息</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>AddModuleInfo <var>module-name</var> <var>string</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>扩展(E)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_info</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">兼容性</a></th><td>仅用于 Apache 1.3 及以上版本</td></tr>
</table>
    <p>本指令将<var>string</var>的内容作为<var>module-name</var>模块的<strong>额外信息</strong>以带HTML注解的方式显示。例如:</p>

    <div class="example"><p><code>
      AddModuleInfo mod_deflate.c 'See &lt;a \<br />
      <span class="indent">
        href="http://www.apache.org/docs/2.2/mod/mod_deflate.html"&gt;\<br />
        http://www.apache.org/docs/2.2/mod/mod_deflate.html&lt;/a&gt;'
      </span>
    </code></p></div>

</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 + -