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

📄 install.html

📁 这个是我在web培训时老师提供的手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<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 中文版参考手册</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月4日 | <a href="./translator_announcement.html#last_new">获取最新版本</a></div>
<div id="page-content"><div id="preamble"><h1>编译与安装</h1>



    <p>本文仅阐述Apache在Unix和类Unix系统中的编译和安装,在Windows中的编译和安装可以参考<a href="platform/windows.html">在Microsoft Windows中使用Apache</a>。其他平台可以参见<a href="platform/index.html">针对特定平台的说明</a>文档。</p>

    <p>像其它许多开源项目一样,Apache使用<code>libtool</code>和<code>autoconf</code>建立编译环境。</p>

    <p>如果你只进行很小的版本升级(比如2.2.54→2.2.55),请直接跳转到下面的<a href="#upgrading">升级</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="overview" id="overview">针对心急者的概述</a></h2>

    <table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA">
<tr><td><a href="#download">下载</a></td><td><code>$ lynx http://httpd.apache.org/download.cgi</code>
        </td></tr>
<tr><td><a href="#extract">解压</a></td><td><code>$ gzip -d httpd-<em>NN</em>.tar.gz<br />
         $ tar xvf httpd-<em>NN</em>.tar<br />
         $ cd httpd-<em>NN</em></code></td></tr>
<tr><td><a href="#configure">配置</a></td><td><code>$ ./configure --prefix=<em>PREFIX</em></code>
        </td></tr>
<tr><td><a href="#compile">编译</a></td><td><code>$ make</code> </td></tr>
<tr><td><a href="#install">安装</a></td><td><code>$ make install</code> </td></tr>
<tr><td><a href="#customize">配置</a></td><td><code>$ vi <em>PREFIX</em>/conf/httpd.conf</code> </td></tr>
<tr><td><a href="#test">测试</a></td><td><code>$ <em>PREFIX</em>/bin/apachectl -k start</code>
        </td></tr>
</table>

    <p>其中<em>NN</em>必须用当前的副版本号替代;<em>PREFIX</em>是服务器被安装到文件系统中的路径名,如果没有指定<em>PREFIX</em>,默认会装到<code>/usr/local/apache2</code></p>

    <p>下面从编译和安装Apache httpd的要求开始详细阐述编译和安装的每个步骤。</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="requirements" id="requirements">要求</a></h2>

    <p>编译Apache的要求如下:</p>

    <dl>
      <dt>磁盘空间</dt>
      <dd>必须保证有50MB以上的自由临时磁盘空间。Apache安装完毕后会占据10MB左右的空间,实际的磁盘空间需求会因编译设置和是否安装第三方模块而有所不同。</dd>

      <dt>ANSI-C编译器及编译环境</dt>
      <dd>必须装有ANSI-C编译器,推荐使用<a href="http://www.gnu.org/">自由软件基金会(FSF)</a>的<a href="http://gcc.gnu.org/">GCC</a>。如果没有GCC,那么要确保使用的编译器符合ANSI标准,而且<code>PATH</code>中必须包含指向基本编译工具比如<code>make</code>的路径。</dd>

      <dt>确保准确的时间</dt>
      <dd>由于HTTP协议的元素都会用到时间,有必要了解一下你的系统所使用的时间同步机制。在基于网络时间协议(NTP)的系统中,一般是用<code>ntpdate</code>或<code>xntpd</code>来同步时间。有关NTP软件的资料请参见<a href="http://www.ntp.org">NTP主页</a>。</dd>

      <dt><a href="http://www.perl.org/">Perl 5</a> [可选]</dt>
      <dd>有些用Perl写的支持脚本,如<code class="program"><a href="./programs/apxs.html">apxs</a></code>或<code class="program"><a href="./programs/dbmmanage.html">dbmmanage</a></code>  ,需要Perl5解释器(5.003或以上的版本就足够了)。如果系统中存在多个Perl解释器,比如有系统提供的Perl 4,还有你自己安装的Perl 5,推荐你使用 <code>--with-perl</code> 选项来确保<code class="program"><a href="./programs/configure.html">configure</a></code>脚本使用正确的版本。如果<code class="program"><a href="./programs/configure.html">configure</a></code>没有没找到Perl 5也没关系,这并不影响Apache httpd的编译和安装,只是相关的支持脚本不能使用而已。</dd>

      <dt><a href="http://apr.apache.org">apr/apr-util &gt;= 1.2</a></dt>
      <dd><code>apr</code>和<code>apr-util</code>包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果<code>apr</code>或<code>apr-util</code>的1.0或1.1版本已经安装在你的系统中了,则必须将你的<code>apr</code>/<code>apr-util</code>升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的<code>apr</code>/<code>apr-util</code>源代码进行安装,你必须手动完成:
<div class="example"><p><code>
# 编译和安装 apr 1.2<br />
cd srclib/apr<br />
./configure --prefix=/usr/local/apr-httpd/<br />
make<br />
make install<br />
<br />
# 编译和安装 apr-util 1.2<br />
cd ../apr-util<br />
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/<br />
make<br />
make install<br />
<br />
# 配置 httpd<br />
cd ../../<br />
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/<br />
</code></p></div>
      </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="download" id="download">下载</a></h2>

    <p>Apache可以从<a href="http://httpd.apache.org/download.cgi">Apache HTTP服务器下载站点</a>及其镜像站点下载。大多数类UNIX系统的Apache用户最好的选择是下载源代码并编译一个适合自己的版本,这个过程(下面将要讲述)是很简单的,它允许你根据自己的需求进行定制。另一方面编译好的二进制版本通常没有进行及时的更新。如果你下载的是编译好的二进制版本,请按照其中的<code>INSTALL.bindist</code>文件进行安装。</p>

    <p>下载完毕后,应该对下载来的tar包作<a href="http://httpd.apache.org/dev/verification.html">PGP签名校验</a>,以确保其完整而且未被篡改过。(<a href="http://httpd.apache.org/download.cgi#verify">PGP下载页面</a>)</p>

</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>

⌨️ 快捷键说明

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