<?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>haohtml&#039;s blog &#187; so</title>
	<atom:link href="http://blog.haohtml.com/tag/so/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.haohtml.com</link>
	<description>haohtml&#039;s life and works</description>
	<lastBuildDate>Tue, 07 Feb 2012 13:56:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>apache apx 添加模块[基本语法]</title>
		<link>http://blog.haohtml.com/archives/963</link>
		<comments>http://blog.haohtml.com/archives/963#comments</comments>
		<pubDate>Fri, 16 Jan 2009 12:01:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apx]]></category>
		<category><![CDATA[so]]></category>

		<guid isPermaLink="false">http://www.51english.net.cn/?p=963</guid>
		<description><![CDATA[Apache安装完成后，添加mod_proxy模块 作者：wind &#124; 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明 网址：http://60.190.88.90/ljf/2008/05/apachemod-proxy.html apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具，用于编译一个或多个源程序或目标代码文件为动态共享对象，使之可以用LoadModule指令在运行时加载到Apache服务器中。 1. 进入apache源代码的modules目录 2. 运行如下命令自动编译、安装和修改httpd.conf文件，激活mod_proxy模块： apache path/bin/apxs -c -i -a mod_proxy.c proxy_util.c 选项说明： -c 执行编译操作 -i 安装操作，安装一个或多个动态共享对象到服务器的modules目录 -a 自动增加一个LoadModule行到httpd.conf文件，以激活此模块，若此行存在则启用之 -A 与-a类似，但是它增加的LoadModule行前有井号前缀(#) -e 需要执行编辑操作，可与-a和-A选项配合使用，与-i操作类似，修改httpd.conf文件，但并不安装此模块 3. 重启apache。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="如何向已经安装好的apache添加一个模块" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何向已经安装好的apache添加一个模块</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache下实现隐藏服务器名称" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F10761&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/31/20204251.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache下实现隐藏服务器名称</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache内存报死" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F878&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache内存报死</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache 的信息查看模块——Server-Status" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1415&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4026369.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache 的信息查看模块——Server-Status</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Apache安装完成后，添加mod_proxy模块<br />
作者：wind | 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明<br />
网址：<a href="http://60.190.88.90/ljf/2008/05/apachemod-proxy.html">http://60.190.88.90/ljf/2008/05/apachemod-proxy.html</a><br />
apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具，用于编译一个或多个源程序或目标代码文件为动态共享对象，使之可以用LoadModule指令在运行时加载到Apache服务器中。</p>
<p>1. 进入apache源代码的modules目录</p>
<p>2. 运行如下命令自动编译、安装和修改httpd.conf文件，激活mod_proxy模块：</p>
<p>apache path/bin/apxs -c -i -a mod_proxy.c proxy_util.c</p>
<p>选项说明：<br />
-c 执行编译操作<br />
-i 安装操作，安装一个或多个动态共享对象到服务器的modules目录<br />
-a 自动增加一个LoadModule行到httpd.conf文件，以激活此模块，若此行存在则启用之<br />
-A 与-a类似，但是它增加的LoadModule行前有井号前缀(#)<br />
-e 需要执行编辑操作，可与-a和-A选项配合使用，与-i操作类似，修改httpd.conf文件，但并不安装此模块</p>
<p>3. 重启apache。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="如何向已经安装好的apache添加一个模块" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何向已经安装好的apache添加一个模块</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache下实现隐藏服务器名称" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F10761&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/31/20204251.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache下实现隐藏服务器名称</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache内存报死" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F878&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache内存报死</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache 的信息查看模块——Server-Status" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1415&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4026369.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache 的信息查看模块——Server-Status</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/963/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何向已经安装好的apache添加一个模块</title>
		<link>http://blog.haohtml.com/archives/960</link>
		<comments>http://blog.haohtml.com/archives/960#comments</comments>
		<pubDate>Fri, 16 Jan 2009 11:57:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[so]]></category>

		<guid isPermaLink="false">http://www.51english.net.cn/?p=960</guid>
		<description><![CDATA[以前一直有这样的需求，是说apache缺少我需要的模块，可是如何在不影响现有程序的基础上，直接添加一个loadModule呢，但是模块文件从哪里来？从另外一个系统复制一份过来是否可行？虽然只是一个 foo.so 文件，放到module文件夹就可以了，但我还是查了一下资料，找到合适的方法，并且尝试过了。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Apache下实现隐藏服务器名称" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F10761&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/31/20204251.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache下实现隐藏服务器名称</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache图片防盗链" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F9422&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache图片防盗链</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache apx 添加模块[基本语法]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache apx 添加模块[基本语法]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎么检查windows下apache加载的mpm模块是什么？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F7363&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4022697.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎么检查windows下apache加载的mpm模块是什么？</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div id="zoomtext" class="textbox-content">以前一直有这样的需求，是说apache缺少我需要的模块，可是如何在不影响现有程序的基础上，直接添加一个loadModule呢，但是模块文件从哪里来？从另外一个系统复制一份过来是否可行？虽然只是一个 foo.so 文件，放到module文件夹就可以了，但我还是查了一下资料，找到合适的方法，并且尝试过了。</p>
<p>这个是<a href="http://hi.baidu.com/howard_2008/blog/item/33cda0c71e9794d8d10060d5.html" target="_blank">原文</a>：</p>
<div class="quote">
<div class="quote-title">引用</div>
<div class="quote-content"><strong>apache 添加 mod_rewrite 模块</strong></p>
<p>我使用的是httpd 2.0.55 注意配置httpd.conf 时 是 rewrite_module 而不是 mod_rewrite</p>
<p>1、Apache安装rewrite模块的时候需要DBM支持，否则无法编译。使用rpm -qa gdbm 查询，如果没有，需要先下载并安装gdbm：<br />
下载地址：ftp://ftp.gnu.org/gnu/gdbm/</p>
<p>安装步骤:<br />
./configure<br />
make<br />
make install<br />
make install-compat (如果不执行此步,无法编译出ndbm.h头文件)</p>
<p>2、安装<br />
#cd /root/src/httpd-2.0.55/modules/mappers<br />
#/usr/local/apache/bin/apxs -c mod_rewrite.c<br />
#gcc -shared -o mod_rewrite.so mod_rewrite.o -lgdbm<br />
#/usr/local/apache/bin/apxs -i -A -n mod_rewrite mod_rewrite.so</p>
<p>/usr/local/apache/bin/ 是我正在使用的apahce的目录</p>
<p>3、配置httpd.conf<br />
加入 LoadModule rewrite_module modules/mod_rewrite.so</p>
<p>注意是 rewrite_module 而不是 mod_rewrite</p></div>
</div>
<p>过程其实很容易理解：<br />
1 在httpd的源文件里面找到 foo.c<br />
2 运行程序编译出 foo.so<br />
3 在httpd.conf添加进来</p>
<p>这里面要注意的两点：<br />
1 foo.c是按功能放置在modules目录的，自己找到相应目录<br />
2 loadModule命令默认是注释的，要去掉后还要改一下名称</p>
<p><strong>下面是尝试expires功能的添加：</strong></p>
<p>cd modules/metadata/<br />
（expires属于metadata功能部分的）<br />
/Data/apps/apache/bin/apxs -c mod_expires.c<br />
gcc -shared -o mod_expires.so mod_expires.o -lgdbm<br />
/Data/apps/apache/bin/apxs -i -A -n mod_expires mod_expires.so</p>
<p>编辑httpd.conf文件<br />
LoadModule expires_module modules/mod_expires.so</p>
<p>然后测试一下：</p>
<div class="quote">
<div class="quote-title">引用</div>
<div class="quote-content">
[root@localhost apache]# ./bin/apachectl -t<br />
Syntax OK<br />
[root@localhost apache]# ./bin/apachectl graceful</div>
</div>
<p>这个模块很实用，可以给你带来带宽的节省<br />
比如如下配置：</p>
<div class="code">   &lt;IfModule mod_expires.c&gt;<br />
       ExpiresActive On<br />
       ExpiresDefault "access plus 6 hours"<br />
       ExpiresByType text/html "access plus 0 hours"<br />
   &lt;/IfModule&gt;</div>
<p>启用expires，默认缓存6小时，但不缓存 text/html<br />
也就是访问阿权的网页<br />
http://www.aslibra.com/blog/read.php?132 不会缓存网页<br />
http://www.aslibra.com/blog/up/1158240093.jpg 缓存图片和脚本等</p>
<p>意思就是这样了</p></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Apache下实现隐藏服务器名称" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F10761&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/31/20204251.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache下实现隐藏服务器名称</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Apache图片防盗链" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F9422&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Apache图片防盗链</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache apx 添加模块[基本语法]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache apx 添加模块[基本语法]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎么检查windows下apache加载的mpm模块是什么？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F7363&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4022697.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎么检查windows下apache加载的mpm模块是什么？</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/960/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>添加mod_rewrite.c模块</title>
		<link>http://blog.haohtml.com/archives/958</link>
		<comments>http://blog.haohtml.com/archives/958#comments</comments>
		<pubDate>Fri, 16 Jan 2009 11:56:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[so]]></category>

		<guid isPermaLink="false">http://www.51english.net.cn/?p=958</guid>
		<description><![CDATA[/etc/apache2/httpd.conf 

加入 

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so 

如果你的服务器apache还没有安装，那很简单，在编译apache时将mod_rewrite模块编译进去就可以，相关文档可以在 www.gbunix.com中找到。如果你的apache已经安装好了，现在只想编译出mod_rewrite.so模块，在apache中进行加载，下面我们就介绍这个方法。 <table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="apache apx 添加模块[基本语法]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache apx 添加模块[基本语法]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="如何向已经安装好的apache添加一个模块" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何向已经安装好的apache添加一个模块</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache中url_rewrite重写的一些正则的基本用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F3136&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache中url_rewrite重写的一些正则的基本用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Apache的rewrite技术" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F2976&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Apache的rewrite技术</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div class="blog_content">/etc/apache2/httpd.conf</p>
<p>加入</p>
<p>LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so</p>
<p>如果你的服务器apache还没有安装，那很简单，在编译apache时将mod_rewrite模块编译进去就可以，相关文档可以在 www.gbunix.com中找到。如果你的apache已经安装好了，现在只想编译出mod_rewrite.so模块，在apache中进行加载，下面我们就介绍这个方法。</p>
<p>以Solaris操作系统进行举例：</p>
<div class="dp-highlighter">
<div class="bar">
<div class="tools"><strong>Ruby代码</strong> <a title="复制代码" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://hooney.javaeye.com/blog/158072#"></a></div>
</div>
<ol class="dp-rb">
<li><span><span class="comment"><span style="color: #008200;"># PATH=/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:$PATH </span></span><span>  </span></span></li>
<li><span class="comment"><span style="color: #008200;"># export PATH </span></span><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># which gcc </span></span><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># which make </span></span><span>  </span></li>
<li><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># find ./ -name mod_rewrite.c //在apache的安装目录中寻找mod_rewrite.c文件 </span></span><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># cd PATH/to/mod_rewrite.c //进入包含mod_rewrite.c文件的目录 </span></span><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># apxs -c mod_rewrite.c //apxs请指定绝对路径，在你当前正在使用apache的bin目录里 </span></span><span>  </span></li>
<li><span class="comment"><span style="color: #008200;"># apxs -i -a -n mod_rewrite mod_rewrite.c </span></span><span>  </span></li>
<li><span>  </span></li>
<li><span>  </span></li>
<li><span>[color=indigo]以下是加GeoIP模块的install方法。借鉴：[/color]   </span></li>
<li><span>To build mod_geoip as a dynamically loadable </span><span class="keyword"><strong><span style="color: #7f0055;">module</span></strong></span><span>:   </span></li>
<li><span>  </span></li>
<li><span>apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c   </span></li>
<li><span>  </span></li>
<li><span>-I/usr/local/include is where the GeoIP.h header file is installed   </span></li>
<li><span>-L/usr/local/lib is where the libGeoIP library is located   </span></li>
<li><span>  </span></li>
<li><span>This will put the correct LoadModule statement.  </span></li>
</ol>
</div>
<pre class="ruby" style="display: none;"># PATH=/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:$PATH
# export PATH
# which gcc
# which make

# find ./ -name mod_rewrite.c //在apache的安装目录中寻找mod_rewrite.c文件
# cd PATH/to/mod_rewrite.c //进入包含mod_rewrite.c文件的目录
# apxs -c mod_rewrite.c //apxs请指定绝对路径，在你当前正在使用apache的bin目录里
# apxs -i -a -n mod_rewrite mod_rewrite.c

[color=indigo]以下是加GeoIP模块的install方法。借鉴：[/color]
To build mod_geoip as a dynamically loadable module:

apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c

-I/usr/local/include is where the GeoIP.h header file is installed
-L/usr/local/lib is where the libGeoIP library is located

This will put the correct LoadModule statement.</pre>
<p>如果没有什么错误的话，应该在你的apache的modules目录中编译出一个mod_rewrite.so文件。</p>
<p>编辑httpd.conf文件，确认httpd.conf中已经包含mod_rewrite.so的加载语句，如下：</p>
<p>LoadModule rewrite_module modules/mod_rewrite.s</p>
<p>怎么才能向一个已安装的程序里面添加模块？</p>
<p>前提：你的apache是支持dso模式的，否则只能重新完全编译：<br />
方法1:<br />
安装一份全新全新的完全相同版本的apache到另外一个目录，记得打开你需要的模块，然后把安装之后的模板拷贝或者调用到现在的。</p>
<p>方法２:<br />
apxs方法，这个很简单：http://w.yi.org/ftp/FAPM/apache/Apache2/zh/programs/apxs.html<br />
apxs - APache扩展工具<br />
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>
<div class="dp-highlighter">
<div class="bar">
<div class="tools">Ruby代码 <a title="复制代码" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://hooney.javaeye.com/blog/158072#"><img src="http://hooney.javaeye.com/images/icon_copy.gif" alt="复制代码" /></a></div>
</div>
<ol class="dp-rb">
<li><span><span>  </span></span></li>
<li><span>$ apxs -i -a -c mod_foo.c   </span></li>
<li><span>gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c   </span></li>
<li><span>ld -Bshareable -o mod_foo.so mod_foo.o   </span></li>
<li><span>cp mod_foo.so /path/to/apache/modules/mod_foo.so   </span></li>
<li><span>chmod 755 /path/to/apache/modules/mod_foo.so   </span></li>
<li><span>[activating </span><span class="keyword"><strong><span style="color: #7f0055;">module</span></strong></span><span> `foo' </span><span class="keyword"><strong><span style="color: #7f0055;">in</span></strong></span><span> /path/to/apache/etc/httpd.conf]   </span></li>
<li><span>$ apachectl restart   </span></li>
<li><span>/path/to/apache/sbin/apachectl restart: httpd </span><span class="keyword"><strong><span style="color: #7f0055;">not</span></strong></span><span> running, trying to start   </span></li>
<li><span>[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded </span><span class="keyword"><strong><span style="color: #7f0055;">module</span></strong></span><span> foo_module   </span></li>
<li><span>/path/to/apache/sbin/apachectl restart: httpd started   </span></li>
<li><span>$ _  </span></li>
</ol>
</div>
<pre class="ruby" style="display: none;">$ apxs -i -a -c mod_foo.c
gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c
ld -Bshareable -o mod_foo.so mod_foo.o
cp mod_foo.so /path/to/apache/modules/mod_foo.so
chmod 755 /path/to/apache/modules/mod_foo.so
[activating module `foo' in /path/to/apache/etc/httpd.conf]
$ apachectl restart
/path/to/apache/sbin/apachectl restart: httpd not running, trying to start
[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module
/path/to/apache/sbin/apachectl restart: httpd started
$ _</pre>
<p>其中的参数files可以是任何C源程序文件(.c)或者目标代码文件(.o)，甚至是一个库(.a)。 apxs工具会根据其后缀自动编译C源程序，或连接目标代码和库。 但是，使用预编译的目标代码时，必须保证它们是独立地址代码(position independent code [PIC])， 使之能被动态地加载。如果使用GCC编译，则应该使用-fpic参数；如果使用其他C编译器，则应该查阅其手册，为apxs寻找相应的编译参数。</p>
<p>有关Apache对DSO的支持的详细信息，可以阅读mod_so的文档， 或者直接阅读源程序src/modules/standard/mod_so.c。</p></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="apache apx 添加模块[基本语法]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F963&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache apx 添加模块[基本语法]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="如何向已经安装好的apache添加一个模块" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F960&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何向已经安装好的apache添加一个模块</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="apache中url_rewrite重写的一些正则的基本用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F3136&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache中url_rewrite重写的一些正则的基本用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Apache的rewrite技术" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F2976&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F958">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Apache的rewrite技术</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/958/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

