📄 1248.html
字号:
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=26
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR>
<TR>
<TD colSpan=3><A title=linux知识宝库
href="index.html" tppabs="http://www.linuxhero.com/docs/index.html"><IMG height=83
src="images/header_r1_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c1.gif" width=472 border=0
name=header_r1_c1></A></TD>
<TD colSpan=3>
<form action="http://www.linuxhero.com/docs/search.html" method=get>
<table
style="BORDER-RIGHT: #c4c4c4 1px solid; BORDER-TOP: #c4c4c4 1px solid; BORDER-LEFT: #c4c4c4 1px solid; BORDER-BOTTOM: #c4c4c4 1px solid"
cellspacing=0 cellpadding=3 width="95%" border=0 align="center">
<tbody>
<tr>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif">
<div align=center><font class=normalfont>搜索文章:
<input type=hidden value=result name=action2>
<input type=radio checked value=title name=type>标题
<input type=radio value=content name=type>内容
<input type=image src="images/button_go.gif" tppabs="http://www.linuxhero.com/docs/images/button_go.gif" border=0 name=image2>
</font></div>
</td>
</tr>
<tr>
<td noWrap>
<div align="center">
<input maxlength=100 size=30 name=keyword2>
</div>
</td>
</tr></tbody>
</table>
</form>
</TD>
<TD rowSpan=2><IMG src="images/header_r1_c7.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c7.gif" width=26 border=0 name=header_r1_c7></TD>
<TD><IMG height=83 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1 border=0></TD></TR>
<TR>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif"><IMG height=22
src="images/header_r2_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r2_c1.gif" width=296 border=0
name=header_r2_c1></TD>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colSpan=5>
<DIV align=right><FONT class=normalfont>当前位置:
<A href="index.html" tppabs="http://www.linuxhero.com/docs/index.html">本站首页</A>
<font color="#FF6699">>></font>
<A href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</A> | <A href="copyright.html" tppabs="http://www.linuxhero.com/docs/copyright.html">版权说明</A></font></DIV>
</TD>
<TD><IMG height=22 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=10 cellPadding=0 width="100%" bgColor=#ffffff
border=0>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TR>
<TD vAlign=top align=middle width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
background="images/back.gif" tppabs="http://www.linuxhero.com/docs/images/back.gif" border=0>
<TBODY>
<TR>
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color=blue>编译配置Apache中的Configure</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:仙人掌工作室 (http://cn.internet.com)<br>来自:Linux知识宝库<br>联系方式:无名<br><br> ./Configure文件是一个经常被遗忘的Apache工具。本文介绍如何用./Configure进行编译配置,避免每次编译Apache时进行重复的操作。文章比较了常规方法与使用./Configure这两者各自的优缺点以及如何手工编辑配制文件进行编译配置。<br>
<br>
一、优缺点比较<br>
我们知道,配制Apache编译选项使用的是configure。但除此之外,我们还可以使用Configure。注意两者的差别:常用的那个配制工具是小写c开头的“configure”,这里要讨论的“Configure”以大写的C开头。<br>
<br>
解开Apache源代码之后,configure脚本位于顶级目录下面。一般我们按照如下步骤使用它:<br>
<br>
tar -zvxf apache_1.3.14.tar.gz<br>
<br>
cd apache_1.3.14<br>
<br>
./configure --prefix=/usr/local/apache<br>
<br>
make<br>
<br>
make install<br>
<br>
Configure是位于src子目录下的脚本。它的参数不是通过命令行指定,而是在一个名为Configuration的配置文件中指定。Apache提供一个默认的配置模板文件Configuration.tmpl,其中包含了通用的默认配置值。<br>
<br>
用Configure进行默认安装的过程如下:<br>
<br>
tar -zvxf apache_1.3.14.tar.gz<br>
<br>
cd apache_1.3.14/src<br>
<br>
cp -f Configuration.tmpl Configuration<br>
<br>
vi Configuration<br>
<br>
... 如必要,修改默认配置值<br>
<br>
./Configure<br>
<br>
make<br>
<br>
make install<br>
<br>
<br>
缺点<br>
<br>
用Configure进行配制有几个明显的缺点,至少对初学者来说是这样的。<br>
<br>
首先,这种配制方法并不广为人知。只要是对开放源代码软件有所了解的人,解开源代码并进入它的目录之后,或许会对它的configure脚本感到熟悉,但往往不会进入src子目录去寻找其他什么东西。<br>
<br>
即使知道可以用Configure进行编译配制,Configuration文件本身也可能成为小小的障碍。这是因为,虽然Configuration文件内部包含的说明相当完善,每一行都有丰富的注解说明其作用,但这个文件实在过于庞大,包含了许多大多数人永远不想要加以定制的选项。<br>
<br>
最后,虽然有关这两种配制方法差别的资料略显缺乏,但总地看来初学者最好使用configure,而Configure只适合于经验丰富的用户使用。虽然这并不能算是一个真正的缺点,但它无疑使许多用户驻足而不敢尝试。<br>
<br>
优点<br>
<br>
使用Configure进行编译配制最大的优点在于,它方便了我们将特定的配置信息保存下来以后再用,无需记住冗长的configure命令行选项。<br>
<br>
例如,本人上次编译Apache时使用的configure命令如下:<br>
<br>
./configure --prefix=/usr/local/apache --enable-module=most<br>
<br>
--enable-shared=max --enable-module=auth_dbm<br>
<br>
--enable-module=auth_mysql<br>
<br>
<br>
这还应该算是一次比较简单的编译。问题在于,即使是输入上面这行命令,我也要查看各种参数的语法并努力记住各个模块的名字。对于大多数人来说这并不是一个很重要的问题,但由于我经常要重新构造Apache,这个问题就显得比较突出了。<br>
<br>
configure也有它的好处,它实际上会在src目录下生成一个配制文件,我们可以保存这个文件供以后参考。这个文件就是src/Configuration.apaci。<br>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -