<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OurApache &#187; 编译</title>
	<atom:link href="http://ourapache.com/archives/tag/%e7%bc%96%e8%af%91/feed" rel="self" type="application/rss+xml" />
	<link>http://ourapache.com</link>
	<description>我们致力于一个Apache知识的分享网站</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>linux下查看nginx，apache，mysql，php的编译参数</title>
		<link>http://ourapache.com/archives/286</link>
		<comments>http://ourapache.com/archives/286#comments</comments>
		<pubDate>Thu, 13 Aug 2009 15:57:00 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache基础知识]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[编译]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=286</guid>
		<description><![CDATA[有时候nginx，apache，mysql，php编译完了想看看编译参数可以用以下方法]]></description>
			<content:encoded><![CDATA[<p>有时候nginx，apache，<a href="http://ourapache.com/archives/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>，php编译完了想看看编译参数可以用以下方法</p>
<p><strong>nginx编译参数：</strong></p>
<blockquote><p>#/usr/local/<a href="http://ourapache.com/archives/tag/nginx" class="st_tag internal_tag" rel="tag" title="标签 nginx 下的日志">nginx</a>/sbin/<a href="http://ourapache.com/archives/tag/nginx" class="st_tag internal_tag" rel="tag" title="标签 nginx 下的日志">nginx</a> -V<br />
nginx version: nginx/0.6.32</p>
<p>built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)</p>
<p>configure arguments: &#8211;user=www &#8211;group=www &#8211;prefix=/usr/local/nginx/ &#8211;with-http_stub_status_module &#8211;with-openssl=/usr/local/openssl</p></blockquote>
<p><strong>apache编译参数：</strong></p>
<blockquote><p># cat /usr/local/apache2/build/config.nice<br />
#! /bin/sh</p>
<p>#</p>
<p># Created by configure</p>
<p>“./configure” \</p>
<p>“&#8211;prefix=/usr/local/apache2&#8243; \</p>
<p>“&#8211;with-included-apr” \</p>
<p>“&#8211;enable-so” \</p>
<p>“&#8211;enable-deflate=shared” \</p>
<p>“&#8211;enable-expires=shared” \</p>
<p>“&#8211;enable-<a href="http://ourapache.com/archives/tag/rewrite" class="st_tag internal_tag" rel="tag" title="标签 rewrite 下的日志">rewrite</a>=shared” \</p>
<p>“&#8211;enable-static-support” \</p>
<p>“&#8211;disable-userdir” \</p>
<p>“$@”</p></blockquote>
<p><strong>php编译参数：</strong></p>
<blockquote><p># /usr/local/<a href="http://ourapache.com/archives/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>/bin/<a href="http://ourapache.com/archives/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a> -i |grep configure</p>
<p>Configure Command =&gt; &#8216;./configure&#8217; &#8216;&#8211;prefix=/usr/local/php&#8217; &#8216;&#8211;with-<a href="http://ourapache.com/archives/tag/apxs" class="st_tag internal_tag" rel="tag" title="标签 apxs 下的日志">apxs</a>2=/usr/local/apache2/bin/<a href="http://ourapache.com/archives/tag/apxs" class="st_tag internal_tag" rel="tag" title="标签 apxs 下的日志">apxs</a>&#8217; &#8216;&#8211;with-config-file-path=/usr/local/php/etc&#8217; &#8216;&#8211;with-mysql=/usr/local/mysql&#8217; &#8216;&#8211;with-libxml-dir=/usr/local/libxml2/bin&#8217; &#8216;&#8211;with-gd=/usr/local/gd2&#8242; &#8216;&#8211;with-jpeg-dir&#8217; &#8216;&#8211;with-png-dir&#8217; &#8216;&#8211;with-bz2&#8242; &#8216;&#8211;with-xmlrpc&#8217; &#8216;&#8211;with-freetype-dir&#8217; &#8216;&#8211;with-zlib-dir&#8217;</p></blockquote>
<p><strong>mysql编译参数：</strong></p>
<blockquote><p># cat “/usr/local/mysql/bin/mysqlbug”|grep configure</p>
<p># This is set by configure</p>
<p>CONFIGURE_LINE=”./configure &#8216;&#8211;prefix=/usr/local/mysql&#8217; &#8216;&#8211;localstatedir=/var/lib/mysql&#8217; &#8216;&#8211;with-comment=Source&#8217; &#8216;&#8211;with-server-suffix=-H863&#8242; &#8216;&#8211;with-mysqld-user=mysql&#8217; &#8216;&#8211;without-debug&#8217; &#8216;&#8211;with-big-tables&#8217; &#8216;&#8211;with-charset=gbk&#8217; &#8216;&#8211;with-collation=gbk_chinese_ci&#8217; &#8216;&#8211;with-extra-charsets=all&#8217; &#8216;&#8211;with-pthread&#8217; &#8216;&#8211;enable-static&#8217; &#8216;&#8211;enable-thread-safe-client&#8217; &#8216;&#8211;with-client-ldflags=-all-static&#8217; &#8216;&#8211;with-mysqld-ldflags=-all-static&#8217; &#8216;&#8211;enable-assembler&#8217; &#8216;&#8211;without-isam&#8217; &#8216;&#8211;without-innodb&#8217; &#8216;&#8211;without-ndb-debug&#8217;”</p></blockquote>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年01月6号 -- <a href="http://ourapache.com/archives/27" title="php+mysql+apache编码深度解析">php+mysql+apache编码深度解析</a></li><li>2009年06月7号 -- <a href="http://ourapache.com/archives/251" title="apxs是Apache编译和安装扩展模块的工具">apxs是Apache编译和安装扩展模块的工具</a></li><li>2009年02月17号 -- <a href="http://ourapache.com/archives/142" title="在64位机器上关于Apache 2.2.3版的编译问题">在64位机器上关于Apache 2.2.3版的编译问题</a></li><li>2009年01月5号 -- <a href="http://ourapache.com/archives/19" title="重大漏洞, 让Apache上传不安全-php.rar">重大漏洞, 让Apache上传不安全-php.rar</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/13" title="单独编译apache的rewrite模块">单独编译apache的rewrite模块</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/basic" title="Apache基础知识" rel="tag">Apache基础知识</a>, <a href="http://ourapache.com/archives/tag/mysql" title="mysql" rel="tag">mysql</a>, <a href="http://ourapache.com/archives/tag/nginx" title="nginx" rel="tag">nginx</a>, <a href="http://ourapache.com/archives/tag/php" title="php" rel="tag">php</a>, <a href="http://ourapache.com/archives/tag/%e7%bc%96%e8%af%91" title="编译" rel="tag">编译</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/286/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>apxs是Apache编译和安装扩展模块的工具</title>
		<link>http://ourapache.com/archives/251</link>
		<comments>http://ourapache.com/archives/251#comments</comments>
		<pubDate>Sun, 07 Jun 2009 11:28:35 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache基础知识]]></category>
		<category><![CDATA[apxs]]></category>
		<category><![CDATA[扩展]]></category>
		<category><![CDATA[编译]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=251</guid>
		<description><![CDATA[apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具，用于编译一个或多个源程序或目标代码文件为动态共享对象，使之可以用由mod_so提供的LoadModule指令在运行时加载到Apache服务器中。

因此，要使用这个扩展机制，你的平台必须支持DSO特性，而且Apache httpd必须内建了mod_so模块。]]></description>
			<content:encoded><![CDATA[<p>apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具，用于编译一个或多个源程序或目标代码文件为动态共享对象，使之可以用由mod_so提供的LoadModule指令在运行时加载到Apache服务器中。</p>
<p>因此，要使用这个扩展机制，你的平台必须支持DSO特性，而且Apache httpd必须内建了mod_so模块。apxs工具能自动探测是否具备这样的条件，你也可以自己用这个命令手动探测：</p>
<p>$ httpd -l</p>
<p>该命令的输出列表中应该有mod_so模块。如果所有这些条件均已具备，则可以很容易地借助apxs安装你自己的DSO模块以扩展Apache服务器的功能：</p>
<blockquote><p>$ <a href="http://ourapache.com/archives/tag/apxs" class="st_tag internal_tag" rel="tag" title="标签 apxs 下的日志">apxs</a> -i -a -c mod_foo.c<br />
gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c<br />
ld -Bshareable -o mod_foo.so mod_foo.o<br />
cp mod_foo.so /path/to/apache/modules/mod_foo.so<br />
chmod 755 /path/to/apache/modules/mod_foo.so<br />
[activating module 'foo' in /path/to/apache/etc/httpd.conf]<br />
$ apachectl restart<br />
/path/to/apache/sbin/apachectl restart: httpd not running, trying to start<br />
[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module<br />
/path/to/apache/sbin/apachectl restart: httpd started<br />
$ _</p></blockquote>
<p>其中的参数files可以是任何C源程序文件(.c)、目标代码文件(.o)、甚至是一个库(.a)。apxs工具会根据其后缀自动编译C源程序或者连接目标代码和库。但是，使用预编译的目标代码时，必须保证它们是地址独立代码(PIC)，使之能被动态地加载。如果使用GCC编译，则应该使用 -fpic 参数；如果使用其他C编译器，则应该查阅其手册，为apxs使用相应的编译参数。</p>
<p>有关Apache对DSO的支持的详细信息，可以阅读mod_so文档，或者直接阅读src/modules/standard/mod_so.c源程序。</p>
<p>语法</p>
<blockquote><p>apxs -g [ -S name=value ] -n modname</p>
<p>apxs -q [ -S name=value ] query &#8230;</p>
<p>apxs -c [ -S name=value ] [ -o dsofile ] [ -I incdir ] [ -D name=value ] [ -L libdir ] [ -l libname ] [ -Wc,compiler-flags ] [ -Wl,linker-flags ] files &#8230;</p>
<p>apxs -i [ -S name=value ] [ -n modname ] [ -a ] [ -A ] dso-file &#8230;</p>
<p>apxs -e [ -S name=value ] [ -n modname ] [ -a ] [ -A ] dso-file &#8230;</p></blockquote>
<p>选项<br />
一般选项<br />
-n modname<br />
它明确设置了 -i(安装)和 -g(模板生成)选项的模块名称。对 -g 选项，它是必须的；对 -i 选项，apxs工具会根据源代码判断，或(在失败的情况下)按文件名推测出这个模块的名称。<br />
查询选项<br />
-q<br />
查询某种apxs设置的信息。该选项的query参数可以是下列一个或多个字符串：CC, CFLAGS, CFLAGS_SHLIB, INCLUDEDIR, LD_SHLIB, LDFLAGS_SHLIB, LIBEXECDIR, LIBS_SHLIB, SBINDIR, SYSCONFDIR, TARGET 。<br />
这个参数用于手动查询某些设置。比如，要手动处理Apache的C头文件，可以在Makefile中使用：</p>
<p>INC=-I`apxs -q INCLUDEDIR`</p>
<p>配置选项<br />
-S name=value<br />
此选项可以改变apxs的上述设置。<br />
模板生成选项<br />
-g<br />
此选项生成一个名为name的子目录(见选项 -n)和其中的两个文件：一个是名为mod_name.c的样板模块源程序，可以用来建立你自己的模块，或是学习使用apxs机制的良好开端；另一个则是对应的Makefile ，用于编译和安装此模块。<br />
DSO编译选项<br />
-c<br />
此选项表示需要执行编译操作。它首先会编译C源程序(.c)files为对应的目标代码文件(.o)，然后连接这些目标代码和files中其余的目标代码文件(.o和.a)，以生成动态共享对象dsofile 。如果没有指定 -o 选项，则此输出文件名由files中的第一个文件名推测得到，也就是默认为mod_name.so 。<br />
-o dsofile<br />
明确指定所建立的动态共享对象的文件名，它不能从files文件列表中推测得到。如果没有明确指定，则其文件名将为mod_unknown.so 。<br />
-D name=value<br />
此选项直接传递到给编译命令，用于增加自定义的编译变量。<br />
-I incdir<br />
此选项直接传递到给编译命令，用于增加自定义的包含目录。<br />
-L libdir<br />
此选项直接传递到给连接命令，用于增加自定义的库文件目录。<br />
-l libname<br />
此选项直接传递到给连接命令，用于增加自定义的库文件。<br />
-Wc,compiler-flags<br />
此选项用于向编译命令 libtool &#8211;mode=compile 中附加compiler-flags ，以增加编译器特有的选项。<br />
-Wl,linker-flags<br />
此选项用于向连接命令 libtool &#8211;mode=link 中附加linker-flags ，以增加连接器特有的选项。<br />
DSO的安装和配置选项<br />
-i<br />
此选项表示需要执行安装操作，以安装一个或多个动态共享对象到服务器的modules目录中。<br />
-a<br />
此选项自动增加一个LoadModule行到httpd.conf文件中，以激活此模块，或者，如果此行已经存在，则启用之。<br />
-A<br />
与 -a 选项类似，但是它增加的LoadModule命令有一个井号前缀(#)，即此模块已经准备就绪但尚未启用。<br />
-e<br />
表示需要执行编辑操作，它可以与 -a 和 -A 选项配合使用，与 -i 操作类似，修改Apache的httpd.conf文件，但是并不安装此模块。<br />
举例<br />
假设有一个扩展Apache功能的模块mod_foo.c ，使用下列命令，可以将C源程序编译为共享模块，以在运行时加载到Apache服务器中：</p>
<blockquote><p>$ apxs -c mod_foo.c<br />
/path/to/libtool &#8211;mode=compile gcc &#8230; -c mod_foo.c<br />
/path/to/libtool &#8211;mode=link gcc &#8230; -o mod_foo.la mod_foo.slo<br />
$ _</p></blockquote>
<p>然后，必须修改Apache的配置，以确保有一个LoadModule指令来加载此共享对象。为了简化这一步骤，apxs可以自动进行该操作，以安装此共享对象到”modules”目录，并更新httpd.conf文件，命令如下：</p>
<blockquote><p>$ apxs -i -a mod_foo.la<br />
/path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
/path/to/libtool &#8211;mode=install cp mod_foo.la /path/to/apache/modules &#8230; chmod 755 /path/to/apache/modules/mod_foo.so<br />
[activating module 'foo' in /path/to/apache/conf/httpd.conf]<br />
$ _</p></blockquote>
<p>如果配置文件中尚不存在，会增加下列的行：</p>
<p>LoadModule foo_module modules/mod_foo.so</p>
<p>如果你希望默认禁用此模块，可以使用 -A 选项，即：</p>
<p>$ apxs -i -A mod_foo.c</p>
<p>要快速测试apxs机制，可以建立一个Apache模块样板及其对应的Makefile ：</p>
<blockquote><p>$ apxs -g -n foo<br />
Creating [DIR] foo<br />
Creating [FILE] foo/Makefile<br />
Creating [FILE] foo/modules.mk<br />
Creating [FILE] foo/mod_foo.c<br />
Creating [FILE] foo/.deps<br />
$ _</p></blockquote>
<p>然后，立即可以编译此样板模块为共享对象并加载到Apache服务器中：</p>
<blockquote><p>$ cd foo<br />
$ make all reload<br />
apxs -c mod_foo.c<br />
/path/to/libtool &#8211;mode=compile gcc &#8230; -c mod_foo.c<br />
/path/to/libtool &#8211;mode=link gcc &#8230; -o mod_foo.la mod_foo.slo<br />
apxs -i -a -n “foo” mod_foo.la<br />
/path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
/path/to/libtool &#8211;mode=install cp mod_foo.la /path/to/apache/modules &#8230; chmod 755 /path/to/apache/modules/mod_foo.so<br />
[activating module 'foo' in /path/to/apache/conf/httpd.conf]<br />
apachectl restart<br />
/path/to/apache/sbin/apachectl restart: httpd not running, trying to start<br />
[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module<br />
/path/to/apache/sbin/apachectl restart: httpd started<br />
$ _</p></blockquote>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2008年12月27号 -- <a href="http://ourapache.com/archives/11" title="apxs &#8211; Apache 扩展工具">apxs &#8211; Apache 扩展工具</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/286" title="linux下查看nginx，apache，mysql，php的编译参数">linux下查看nginx，apache，mysql，php的编译参数</a></li><li>2009年02月17号 -- <a href="http://ourapache.com/archives/142" title="在64位机器上关于Apache 2.2.3版的编译问题">在64位机器上关于Apache 2.2.3版的编译问题</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/13" title="单独编译apache的rewrite模块">单独编译apache的rewrite模块</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/basic" title="Apache基础知识" rel="tag">Apache基础知识</a>, <a href="http://ourapache.com/archives/tag/apxs" title="apxs" rel="tag">apxs</a>, <a href="http://ourapache.com/archives/tag/%e6%89%a9%e5%b1%95" title="扩展" rel="tag">扩展</a>, <a href="http://ourapache.com/archives/tag/%e7%bc%96%e8%af%91" title="编译" rel="tag">编译</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/251/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在64位机器上关于Apache 2.2.3版的编译问题</title>
		<link>http://ourapache.com/archives/142</link>
		<comments>http://ourapache.com/archives/142#comments</comments>
		<pubDate>Tue, 17 Feb 2009 04:39:06 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache解错方案]]></category>
		<category><![CDATA[64位]]></category>
		<category><![CDATA[编译]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=142</guid>
		<description><![CDATA[2.2.3版的apache在64位机器上进行编译会出现错误]]></description>
			<content:encoded><![CDATA[<p>2.2.3版的apache在64位机器上进行编译会出现如下错误：</p>
<blockquote><p>usr/lib/libexpat.so: could not read symbols: File in wrong format<br />
collect2: ld returned 1 exit status<br />
make[3]: *** [libaprutil-1.la] 错误 1<br />
make[3]: Leaving directory `/root/tar/httpd-2.2.3/srclib/apr-util&#8217;<br />
make[2]: *** [all-recursive] 错误 1<br />
make[2]: Leaving directory `/root/tar/httpd-2.2.3/srclib/apr-util&#8217;<br />
make[1]: *** [all-recursive] 错误 1<br />
make[1]: Leaving directory `/root/tar/httpd-2.2.3/srclib&#8217;<br />
make: *** [all-recursive] 错误 1<br />
 </p></blockquote>
<p>错误的解决方法可以参考邮件：<a href="http://www.mail-archive.com/bugs@httpd.apache.org/msg24675.html">http://www.mail-archive.com/bugs@httpd.apache.org/msg24675.html</a></p>
<p>具体的做法如下：<br />
1 setenv LDFLAGS “-L/usr/lib64 -L/lib64&#8243;    [用于csh，其他shell请用export命令]<br />
2 ./configure 时加入 &#8211;libdir=/usr/lib64 参数<br />
3 修改./srclib/apr-util/下的Makefile 改 APRUTIL_LIBS 的值中的”/usr/lib/libexpat.la” 为 “/usr/lib64/libexpat.la”<br />
然后进行编译。</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年08月13号 -- <a href="http://ourapache.com/archives/286" title="linux下查看nginx，apache，mysql，php的编译参数">linux下查看nginx，apache，mysql，php的编译参数</a></li><li>2009年06月7号 -- <a href="http://ourapache.com/archives/251" title="apxs是Apache编译和安装扩展模块的工具">apxs是Apache编译和安装扩展模块的工具</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/13" title="单独编译apache的rewrite模块">单独编译apache的rewrite模块</a></li></ul>
	标签：<a href="http://ourapache.com/archives/tag/64%e4%bd%8d" title="64位" rel="tag">64位</a>, <a href="http://ourapache.com/archives/category/debug" title="Apache解错方案" rel="tag">Apache解错方案</a>, <a href="http://ourapache.com/archives/tag/%e7%bc%96%e8%af%91" title="编译" rel="tag">编译</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/142/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>单独编译apache的rewrite模块</title>
		<link>http://ourapache.com/archives/13</link>
		<comments>http://ourapache.com/archives/13#comments</comments>
		<pubDate>Sat, 27 Dec 2008 15:32:34 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache基础知识]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[编译]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=13</guid>
		<description><![CDATA[单独编译apache的rewrite模块]]></description>
			<content:encoded><![CDATA[<p>进入apache的源码目录<br />
# cd httpd-2.0.59<br />
# cd modules<br />
#cd mappers/<br />
# ls</p>
<p>会列出很多文件,其中mod_<a href="http://ourapache.com/archives/tag/rewrite" class="st_tag internal_tag" rel="tag" title="标签 rewrite 下的日志">rewrite</a>.c  这个就是rewrite模块的源码文件<br />
# /usr/local/apache2/bin/<a href="http://ourapache.com/archives/tag/apxs" class="st_tag internal_tag" rel="tag" title="标签 apxs 下的日志">apxs</a> -i -a -c ./mod_rewrite.c</p>
<p>输出如下<br />
/usr/local/apache2/build/libtool &#8211;silent &#8211;mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  -I/usr/local/apache2/include   -I/usr/local/apache2/include   -c -o ./mod_rewrite.lo ./mod_rewrite.c &amp;&amp; touch ./mod_rewrite.slo<br />
/usr/local/apache2/build/libtool &#8211;silent &#8211;mode=link gcc -o ./mod_rewrite.la  -rpath /usr/local/apache2/modules -module -avoid-version    ./mod_rewrite.lo<br />
/usr/local/apache2/build/instdso.sh SH_LIBTOOL=&#8217;/usr/local/apache2/build/libtool&#8217; ./mod_rewrite.la /usr/local/apache2/modules<br />
/usr/local/apache2/build/libtool &#8211;mode=install cp ./mod_rewrite.la /usr/local/apache2/modules/<br />
cp ./.libs/mod_rewrite.so /usr/local/apache2/modules/mod_rewrite.so<br />
cp ./.libs/mod_rewrite.lai /usr/local/apache2/modules/mod_rewrite.la<br />
cp ./.libs/mod_rewrite.a /usr/local/apache2/modules/mod_rewrite.a<br />
ranlib /usr/local/apache2/modules/mod_rewrite.a<br />
chmod 644 /usr/local/apache2/modules/mod_rewrite.a<br />
PATH=”$PATH:/sbin” ldconfig -n /usr/local/apache2/modules<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Libraries have been installed in:<br />
   /usr/local/apache2/modules<br />
If you ever happen to want to link against installed libraries<br />
in a given directory, LIBDIR, you must either use libtool, and<br />
specify the full pathname of the library, or use the `-LLIBDIR&#8217;<br />
flag during linking and do at least one of the following:<br />
   &#8211; add LIBDIR to the `LD_LIBRARY_PATH&#8217; environment variable<br />
     during execution<br />
   &#8211; add LIBDIR to the `LD_RUN_PATH&#8217; environment variable<br />
     during linking<br />
   &#8211; use the `-Wl,&#8211;rpath -Wl,LIBDIR&#8217; linker flag<br />
   &#8211; have your system administrator add LIBDIR to `/etc/ld.so.conf&#8217;<br />
See any operating system documentation about shared libraries for<br />
more information, such as the ld(1) and ld.so(8) manual pages.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
chmod 755 /usr/local/apache2/modules/mod_rewrite.so<br />
[activating module `rewrite' in /usr/local/apache2/conf/httpd.conf]</p>
<p>由输出可以看到rewrite模块已经在httpd.conf中激活了,查看确认<br />
# vi /usr/local/apache2/conf/httpd.conf</p>
<p>可以看到<br />
# LoadModule foo_module modules/mod_foo.so<br />
LoadModule <a href="http://ourapache.com/archives/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>5_module        modules/libphp5.so<br />
LoadModule rewrite_module     modules/mod_rewrite.so</p>
<p>重启apache生效</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年08月13号 -- <a href="http://ourapache.com/archives/286" title="linux下查看nginx，apache，mysql，php的编译参数">linux下查看nginx，apache，mysql，php的编译参数</a></li><li>2009年06月14号 -- <a href="http://ourapache.com/archives/255" title="常见的rewrite规则大全">常见的rewrite规则大全</a></li><li>2009年06月7号 -- <a href="http://ourapache.com/archives/251" title="apxs是Apache编译和安装扩展模块的工具">apxs是Apache编译和安装扩展模块的工具</a></li><li>2009年02月17号 -- <a href="http://ourapache.com/archives/142" title="在64位机器上关于Apache 2.2.3版的编译问题">在64位机器上关于Apache 2.2.3版的编译问题</a></li><li>2009年02月16号 -- <a href="http://ourapache.com/archives/140" title="Apache、resin、rewrite泛域名、多域名设置">Apache、resin、rewrite泛域名、多域名设置</a></li><li>2009年02月12号 -- <a href="http://ourapache.com/archives/136" title="让apache支持自定义404页面错误">让apache支持自定义404页面错误</a></li><li>2009年02月10号 -- <a href="http://ourapache.com/archives/106" title="Apache Rewrite 规则详解">Apache Rewrite 规则详解</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/basic" title="Apache基础知识" rel="tag">Apache基础知识</a>, <a href="http://ourapache.com/archives/tag/rewrite" title="rewrite" rel="tag">rewrite</a>, <a href="http://ourapache.com/archives/tag/%e7%bc%96%e8%af%91" title="编译" rel="tag">编译</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

