<?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>花开的地方 &#187; Apache</title>
	<atom:link href="http://www.bsdmap.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bsdmap.com</link>
	<description>花开，没有声音……</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:39:21 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19814</generator>
		<item>
		<title>Debian/Ubuntu上的Apache管理脚本</title>
		<link>http://www.bsdmap.com/2011/01/05/a2enmod-a2dismod-a2ensite-a2dissite/</link>
		<comments>http://www.bsdmap.com/2011/01/05/a2enmod-a2dismod-a2ensite-a2dissite/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 05:39:49 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SHELL]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=2960</guid>
		<description><![CDATA[a2enmod, a2dismod, a2ensite, a2dissite a2enmod/a2dismod 　启用／禁用模块 a2ensite/a2dissite 启用／禁用虚拟站点 实际上，另外三个文件只是一个指向　a2enmod　的软链接。 Debian与Ubuntu上自带的Apache配置文件，是有自己独特的组织风格的（SUSE也独特），于是想应该有自己的“独特”的管理方式。man -k apache了一下，发现这四个“工具”。 用法非常简单，不跟参数运行，有会“向导”，也可直接跟模块名，或者site名。]]></description>
			<content:encoded><![CDATA[<p>a2enmod, a2dismod, a2ensite, a2dissite</p>
<p>a2enmod/a2dismod 　启用／禁用模块<br />
a2ensite/a2dissite 启用／禁用虚拟站点</p>
<p>实际上，另外三个文件只是一个指向　a2enmod　的软链接。</p>
<p>Debian与Ubuntu上自带的Apache配置文件，是有自己独特的组织风格的（SUSE也独特），于是想应该有自己的“独特”的管理方式。man -k apache了一下，发现这四个“工具”。</p>
<p>用法非常简单，不跟参数运行，有会“向导”，也可直接跟模块名，或者site名。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2011/01/05/a2enmod-a2dismod-a2ensite-a2dissite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用expires模块降低apache负载</title>
		<link>http://www.bsdmap.com/2010/02/24/apache-expires/</link>
		<comments>http://www.bsdmap.com/2010/02/24/apache-expires/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 19:11:44 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[性能相关]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[expires]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[性能]]></category>
		<category><![CDATA[浏览器缓存]]></category>
		<category><![CDATA[缓存]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=2164</guid>
		<description><![CDATA[使用expires模块声明静态文件过期时间-减少客户端不必要的请求 &#60;Location /&#62; &#60;IfModule mod_expires.c&#62; ExpiresActive On ExpiresByType image/* &#8220;access plus 1 month&#8221; ExpiresByType text/css &#8220;access plus 1 month&#8221; ExpiresByType text/javascript   &#8220;access plus 1 month&#8221; ExpiresByType application/x-javascript &#8220;access plus 1 month&#8221; &#60;/IfModule&#62; &#60;/Location&#62; 另一种方式： &#60;FilesMatch &#8220;\.(css&#124;js&#124;jpg&#124;gif&#124;png)$&#8221;&#62; &#60;IfModule mod_expires.c&#62; ExpiresActive  On ExpiresDefault A2592000 &#60;/IfModule&#62; &#60;/FilesMatch&#62;]]></description>
			<content:encoded><![CDATA[<h2>使用expires模块声明静态文件过期时间-减少客户端不必要的请求</h2>
<div id="_mcePaste">&lt;Location /&gt;</div>
<div id="_mcePaste">&lt;IfModule mod_expires.c&gt;</div>
<div id="_mcePaste">ExpiresActive On</div>
<div id="_mcePaste">ExpiresByType image/* &#8220;access plus 1 month&#8221;</div>
<div id="_mcePaste">ExpiresByType text/css &#8220;access plus 1 month&#8221;</div>
<div>ExpiresByType text/javascript   &#8220;access plus 1 month&#8221;</div>
<div>ExpiresByType application/x-javascript &#8220;access plus 1 month&#8221;</div>
<div>&lt;/IfModule&gt;</div>
<div id="_mcePaste">&lt;/Location&gt;</div>
<div>另一种方式：</div>
<div id="_mcePaste">&lt;FilesMatch &#8220;\.(css|js|jpg|gif|png)$&#8221;&gt;</div>
<div id="_mcePaste">&lt;IfModule mod_expires.c&gt;</div>
<div id="_mcePaste">ExpiresActive  On</div>
<div id="_mcePaste">ExpiresDefault A2592000</div>
<div id="_mcePaste">&lt;/IfModule&gt;</div>
<div id="_mcePaste">&lt;/FilesMatch&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/24/apache-expires/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用deflate模块压缩输出</title>
		<link>http://www.bsdmap.com/2010/02/20/apache-deflate-gzip-mod_deflate-2/</link>
		<comments>http://www.bsdmap.com/2010/02/20/apache-deflate-gzip-mod_deflate-2/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 19:21:00 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[deflate]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[uncompress]]></category>
		<category><![CDATA[压缩]]></category>
		<category><![CDATA[撞车效应]]></category>
		<category><![CDATA[系统负载]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1834</guid>
		<description><![CDATA[启用web服务器的压缩功能主要有两个好处： 1. 提高用户打开页面的速度。 2. 节省服务器的带宽资源。 一定会有人认为启用压缩会消耗服务器的CPU及内存资源。就目前的计算机处理能力来讲，这点消耗并不是影响系统负载的“主要矛盾”。相反地，因为启缩，会提高传输效率，从而提高计算机处理请求的速度，从而降低系统负载。 Apache 自带的 mod_deflate 模块，提供了DEFLATE输出过滤器，允许服务器在将输出内容发送到客户端以前进行压缩，以节约带宽。 通常，我们只压缩文本内容，图片文件因为本身已经是压缩格式的，再次压缩的意义不大。 我常用的压缩配置如下： &#60;Location /&#62; &#60;IfModule mod_deflate.c&#62; AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript &#60;/IfModule&#62; &#60;/Location&#62; 需要注意的是：压缩会于代理服务器造成一定的困扰。比如当我使用Nginx的反向代理+缓存（storage）的时候，存储在Nginx本地的文件是压缩过的（比如 a.css 本来应该是文本文件，存在Nginx本地的是被压缩生成的二进制文件），当用户再次请求时，Ngnix反回给用户的是压缩内容，于是用户这边显示乱码。 另外一个需要注意的问题是：Very 头对缓存命中的影响 http://www.chedong.com/blog/archives/001429.html 参考： 《高性能网站建设指南》 http://www.bsdmap.com/manuals/Apache/mod/mod_deflate.html]]></description>
			<content:encoded><![CDATA[<p>启用web服务器的压缩功能主要有两个好处：<br />
1. 提高用户打开页面的速度。<br />
2. 节省服务器的带宽资源。</p>
<p>一定会有人认为启用压缩会消耗服务器的CPU及内存资源。就目前的计算机处理能力来讲，这点消耗并不是影响系统负载的“主要矛盾”。相反地，因为启缩，会提高传输效率，从而提高计算机处理请求的速度，从而降低系统负载。</p>
<p>Apache 自带的 <a href="http://www.bsdmap.com/manuals/Apache/mod/mod_deflate.html">mod_deflate</a> 模块，提供了DEFLATE输出过滤器，允许服务器在将输出内容发送到客户端以前进行压缩，以节约带宽。</p>
<p>通常，我们只压缩文本内容，图片文件因为本身已经是压缩格式的，再次压缩的意义不大。</p>
<p>我常用的压缩配置如下：</p>
<p>&lt;Location /&gt;<br />
&lt;IfModule mod_deflate.c&gt;<br />
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript<br />
&lt;/IfModule&gt;<br />
&lt;/Location&gt;</p>
<p>需要注意的是：压缩会于代理服务器造成一定的困扰。比如当我使用Nginx的反向代理+缓存（storage）的时候，存储在Nginx本地的文件是压缩过的（比如 a.css 本来应该是文本文件，存在Nginx本地的是被压缩生成的二进制文件），当用户再次请求时，Ngnix反回给用户的是压缩内容，于是用户这边显示乱码。</p>
<p>另外一个需要注意的问题是：Very 头对缓存命中的影响 <a href="http://www.chedong.com/blog/archives/001429.html">http://www.chedong.com/blog/archives/001429.html</a></p>
<p>参考：<br />
《高性能网站建设指南》<br />
<a href="http://www.bsdmap.com/manuals/Apache/mod/mod_deflate.html">http://www.bsdmap.com/manuals/Apache/mod/mod_deflate.html<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/20/apache-deflate-gzip-mod_deflate-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用header标识服务器</title>
		<link>http://www.bsdmap.com/2010/02/10/%e4%bd%bf%e7%94%a8header%e6%a0%87%e8%af%86%e6%9c%8d%e5%8a%a1%e5%99%a8/</link>
		<comments>http://www.bsdmap.com/2010/02/10/%e4%bd%bf%e7%94%a8header%e6%a0%87%e8%af%86%e6%9c%8d%e5%8a%a1%e5%99%a8/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:16:30 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[标识]]></category>
		<category><![CDATA[标识服务器]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1847</guid>
		<description><![CDATA[当你在维护集群时，你会发现很难定位服务器。比如我们的 LVS 结构下的后端 RS 出现意外的问题的时候，怎么去定位它？ 最终我们使用的方法是在 RS 上配置、增加一个额外的 header ( 我们的 RS 上运行的是 Web 服务 )，比如： 我在我的每台 web 上都做了如下配置 &#60;IfModule mod_headers.c&#62; # Device ID, A(apache) N (Nginx) L(Lighttpd) S(Squid) V(Varnish), CPU x sum, RAM(G), DISK(G), bandwidth, CNC/TEL/EDU, City Header Append Node &#8220;H01-A1-3.4Gx4-4G-100G-100M-CNC1-CQ1&#8243; &#60;/IfModule&#62; 这样，通过 Firebug ，我就可以很容易地定位服务器，从而快速的定位故障之所在。]]></description>
			<content:encoded><![CDATA[<p>当你在维护集群时，你会发现很难定位服务器。比如我们的 LVS 结构下的后端 RS 出现意外的问题的时候，怎么去定位它？</p>
<p>最终我们使用的方法是在 RS 上配置、增加一个额外的 header ( 我们的 RS 上运行的是 Web 服务 )，比如：</p>
<p>我在我的每台 web 上都做了如下配置<br />
&lt;IfModule mod_headers.c&gt;<br />
# Device ID, A(apache) N (Nginx) L(Lighttpd) S(Squid) V(Varnish), CPU x sum, RAM(G), DISK(G), bandwidth, CNC/TEL/EDU, City<br />
Header Append Node &#8220;H01-A1-3.4Gx4-4G-100G-100M-CNC1-CQ1&#8243;<br />
&lt;/IfModule&gt;</p>
<p>这样，通过 Firebug ，我就可以很容易地定位服务器，从而快速的定位故障之所在。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/10/%e4%bd%bf%e7%94%a8header%e6%a0%87%e8%af%86%e6%9c%8d%e5%8a%a1%e5%99%a8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用apxs为Apache编译模块</title>
		<link>http://www.bsdmap.com/2010/02/06/apache-apxs/</link>
		<comments>http://www.bsdmap.com/2010/02/06/apache-apxs/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:31:04 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1823</guid>
		<description><![CDATA[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. 如果还需要其他proxy模块如mod_proxy_http、mod_proxy_ftp，则单独 apxs -c -i proxy_http.c apxs -c -i proxy_ftp.c 参考： http://www.bsdmap.com/manuals/Apache/programs/apxs.html]]></description>
			<content:encoded><![CDATA[<p>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>选项说明：</p>
<p>-c 执行编译操作<br />
-i 安装操作，安装一个或多个动态共享对象到服务器的modules目录<br />
-a 自动增加一个LoadModule行到httpd.conf文件，以激活此模块，若此行存在则启用之<br />
-A 与-a类似，但是它增加的LoadModule行前有井号前缀(#)<br />
-e 需要执行编辑操作，可与-a和-A选项配合使用，与-i操作类似，修改httpd.conf文件，但并不安装此模块<br />
3. 如果还需要其他proxy模块如mod_proxy_http、mod_proxy_ftp，则单独</p>
<p>apxs -c -i proxy_http.c<br />
apxs -c -i proxy_ftp.c</p>
<p>参考：<br />
<a href="http://www.bsdmap.com/manuals/Apache/programs/apxs.html"> http://www.bsdmap.com/manuals/Apache/programs/apxs.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/06/apache-apxs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用RCS管理配置文件</title>
		<link>http://www.bsdmap.com/2010/02/06/rcs/</link>
		<comments>http://www.bsdmap.com/2010/02/06/rcs/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 07:33:51 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[版本控制]]></category>
		<category><![CDATA[RCS]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1729</guid>
		<description><![CDATA[时下是SVN和Git大行其道的时候，RCS出现的频率很小。 RCS，全称 Revision Control System ，一种版本控制系统，用于保存配置文件、Shell脚本和其他任何操作过的文本文件的多个修订版本。与SVN、Git、以及CVS不同的是，RCS不支持C/S结构，RCS的所有内容都保存在本地文件系统中。因此，RCS，不适合多人协作（于是出了SVN、Git这样的版本控制系统），相反的却非常适合管理员(甚至是多位管理员)来管理配置文件。假如你有很多机器要管理，那么另当别论！ RCS将所有修订版本都保存在文件当前目录下名为RCS/的目录中，假如该目录不存在，则保存在与文件相同的目录里。为了不使当前目录看上去很凌乱，建议使用RCS目录。 以Apache配置为例： 1. 创建仓库 mkdir /etc/httpd/conf/RCS 2. 将配置文件httpd.conf初始化到仓库中 ci -i /etc/httpd/conf/httpd.conf /etc/httpd/conf/RCS/httpd.conf,v &#60;&#8211; /etc/httpd/conf/httpd.conf enter description, terminated with single &#8216;.&#8217;or end of file: NOTE: This is NOT the log message! &#62;&#62; Apache Configuration Files &#62;&#62; . initial revision: 1.1 done ci -i 进行“登入和初始化”，为RCS提供文件的第一份完好的副本。RCS提示输入初始化说明，然后从当前目录中删除该文件。 3. 登出文件 co /etc/httpd/conf/httpd.conf /etc/httpd/conf/RCS/httpd.conf,v &#8211;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>时下是<a href="http://subversion.tigris.org/" target="_blank">SVN</a>和<a href="http://git-scm.com/" target="_blank">Git</a>大行其道的时候，<a href="http://www.gnu.org/software/rcs/" target="_blank">RCS</a>出现的频率很小。</p>
<p>RCS，全称 Revision Control System ，一种版本控制系统，用于保存配置文件、Shell脚本和其他任何操作过的<strong>文本文件</strong>的多个修订版本。与SVN、Git、以及CVS不同的是，RCS不支持C/S结构，RCS的所有内容都保存在本地文件系统中。因此，<strong>RCS，不适合多人协作（于是出了SVN、Git这样的版本控制系统），相反的却非常适合管理员(甚至是多位管理员)来管理配置文件</strong>。假如你有很多机器要管理，那么另当别论！</p>
<p>RCS将所有修订版本都保存在文件当前目录下名为RCS/的目录中，假如该目录不存在，则保存在与文件相同的目录里。为了不使当前目录看上去很凌乱，建议使用RCS目录。</p>
<p>以Apache配置为例：</p>
<p><strong>1. 创建仓库</strong><br />
mkdir /etc/httpd/conf/RCS<br />
<strong>2. 将配置文件httpd.conf初始化到仓库中<br />
</strong>ci -i /etc/httpd/conf/httpd.conf<br />
<span style="color: #c0c0c0;">/etc/httpd/conf/RCS/httpd.conf,v  &lt;&#8211;  /etc/httpd/conf/httpd.conf<br />
enter description, terminated with single &#8216;.&#8217;or end of file:<br />
NOTE: This is NOT the log message!</span><br />
&gt;&gt; <span style="color: #000000;">Apache Configuration Files<br />
</span>&gt;&gt; .<br />
<span style="color: #c0c0c0;">initial revision: 1.1<br />
done<br />
</span>ci -i 进行“登入和初始化”，为RCS提供文件的第一份完好的副本。RCS提示输入初始化说明，然后从当前目录中删除该文件。<br />
<strong>3. 登出文件<br />
</strong>co /etc/httpd/conf/httpd.conf<br />
<span style="color: #c0c0c0;">/etc/httpd/conf/RCS/httpd.conf,v  &#8211;&gt;  /etc/httpd/conf/httpd.conf<br />
revision 1.1<br />
done</span><br />
在RCS初始化文件文件后，登出该文件。<br />
<strong>4. 操作配置文件<br />
</strong>锁定文件，以防操作时其他用户对访文件进行更新。实际上，RCS是使用文件权限来控制“锁”的，比如co httpd.conf的时候，httpd.conf的文件权限被设置成444，于是不能编辑，当co -l httpd.conf时，权限被设置成 644，于是可以编辑，当ci -u httpd.conf，文件权限又被设置成444。<br />
co -l /etc/httpd/conf/httpd.conf<br />
<span style="color: #c0c0c0;">/etc/httpd/conf/RCS/httpd.conf,v  &#8211;&gt;  /etc/httpd/conf/httpd.conf<br />
revision 1.1 (locked)<br />
done</span><br />
现在可以随意修改了。<br />
<strong>5. 提交文件<br />
</strong>完成编辑工作后，重新登入并用ci -u 解锁<br />
ci -u /etc/httpd/conf/httpd.conf<br />
<span style="color: #888888;">/etc/httpd/conf/RCS/httpd.conf,v  &lt;&#8211;  /etc/httpd/conf/httpd.conf<br />
new revision: 1.2; previous revision: 1.1<br />
enter log message, terminated with single &#8216;.&#8217;or end of file:<br />
</span>&gt;&gt; unload negotiation_module and negotiation_module<br />
&gt;&gt; .<br />
<span style="color: #888888;">done</span><br />
<span style="color: #ff0000;">请务必使用有意义的日志！</span><br />
<strong>6. 查看文件修改了哪些内容</strong><br />
比如我加载了mod_logio模块：<br />
rcsdiff  /etc/httpd/conf/httpd.conf<br />
<span style="color: #888888;">==================================<br />
RCS file: RCS/httpd.conf,v<br />
retrieving revision 1.2<br />
diff -r1.2 httpd.conf<br />
167c167<br />
&lt; #LoadModule logio_module modules/mod_logio.so<br />
&#8212;<br />
&gt; LoadModule logio_module modules/mod_logio.so</span><br />
也可以查看两个不同版本之间的差别<br />
rcsdiff -r1.1 -r1.2 httpd.conf<br />
<strong>7. 查看修订log</strong><br />
rlog /etc/httpd/conf/httpd.conf<br />
<strong>8. 登出某个版本</strong><br />
co -l -r1.1 /etc/httpd/conf/httpd.conf<br />
<strong>9. 常见问题( Troubleshooting)</strong><br />
常见的是在登入或者登出的时候出现问题，那可能是在某些节点忘记了 -l （在co中）或 -u（在ci中）选项。通常可以先制作备份，然后再次登出该文件并复回原来的位置：<br />
cd /etc/httpd/conf<br />
cp httpd.conf httpd.conf.bk<br />
co -l httpd.conf<br />
cp httpd.conf.bk httpd.conf<br />
ci -u httpd.conf</p>
<p>6.参考：<br />
《Linux Server Hacks》<br />
<a href="http://www.juyimeng.com/httpd-conf-version-control.html" target="_blank">http://www.juyimeng.com/httpd-conf-version-control.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/06/rcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>编译安装Apache</title>
		<link>http://www.bsdmap.com/2010/02/03/compile-apache/</link>
		<comments>http://www.bsdmap.com/2010/02/03/compile-apache/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 06:23:10 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1703</guid>
		<description><![CDATA[温习编译Apahce的相关知识 预备知识 Makefile的惯例 make clean 清除当前目录下在 make 过程中产生的文件。它不能删除软件包的配置文件，也不能删除 build 时创建的那些文件。 make distclean 类似于&#8221;clean&#8221;，但增加删除当前目录下的的配置文件、build 过程产生的文件。 make install-strip 和&#8221;make install&#8221;类似，但是会对复制到安装目录下的可执行文件进行 strip 操作。 make的常用选项 -jN , &#8211;jobs[=N]，指定并行执行的命令数目。 -n &#8211;just-print,&#8211;dry-run,&#8211;recon，只打印出所要执的命令，但并不实际执行命令。 -s &#8211;silent，&#8211;quit，不显示所执行的命令。 编译Apache的要求 磁盘空间 ANSI-C编译器及编译环境 确保准确的时间 Perl 5 [可选] apr/apr-util &#62;= 1.2 apr和apr-util包含在Apache httpd的发行源代码中，并且在绝大多数情况下使用都不会出现问题。当然，如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了，则必须将你的apr/apr-util升级到1.2版本，或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安装，你必须手动完成： # 编译和安装 apr 1.2 cd srclib/apr ./configure &#8211;prefix=/usr/local/apr-httpd/ make make install # 编译和安装 apr-util 1.2 [...]]]></description>
			<content:encoded><![CDATA[<h1>温习编译Apahce的相关知识</h1>
<h2>预备知识</h2>
<h3>Makefile的惯例</h3>
<ol>
<li><strong>make clean</strong> 清除当前目录下在 make 过程中产生的文件。它不能删除软件包的配置文件，也不能删除 build 时创建的那些文件。</li>
<li><strong>make distclean</strong> 类似于&#8221;clean&#8221;，但增加删除当前目录下的的配置文件、build 过程产生的文件。</li>
<li><strong>make install-strip</strong> 和&#8221;make install&#8221;类似，但是会对复制到安装目录下的可执行文件进行 <a href="http://www.bsdmap.com/2008/12/07/strip/" target="_blank">strip</a> 操作。</li>
</ol>
<h3>make的常用选项</h3>
<ol>
<li>-jN , &#8211;jobs[=N]，指定并行执行的命令数目。</li>
<li>-n &#8211;just-print,&#8211;dry-run,&#8211;recon，只打印出所要执的命令，但并不实际执行命令。</li>
<li>-s &#8211;silent，&#8211;quit，不显示所执行的命令。</li>
</ol>
<h2>编译Apache的要求</h2>
<ol>
<li>磁盘空间</li>
<li>ANSI-C编译器及编译环境</li>
<li>确保准确的时间</li>
<li>Perl 5 [可选]</li>
<li>apr/apr-util &gt;= 1.2</li>
</ol>
<p style="padding-left: 30px;">apr和apr-util包含在Apache httpd的发行源代码中，并且在绝大多数情况下使用都不会出现问题。当然，如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了，则必须将你的apr/apr-util升级到1.2版本，或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安装，你必须手动完成：<br />
# 编译和安装 apr 1.2<br />
cd srclib/apr<br />
./configure &#8211;prefix=/usr/local/apr-httpd/<br />
make<br />
make install</p>
<p style="padding-left: 30px;"># 编译和安装 apr-util 1.2<br />
cd ../apr-util<br />
./configure &#8211;prefix=/usr/local/apr-util-httpd/ &#8211;with-apr=/usr/local/apr-httpd/<br />
make<br />
make install</p>
<p style="padding-left: 30px;"># 配置 httpd<br />
cd ../../<br />
./configure &#8211;with-apr=/usr/local/apr-httpd/ &#8211;with-apr-util=/usr/local/apr-util-httpd/</p>
<h2>Apache的模块状态</h2>
<p>通常我们认为Apache的模块分五类：多路处理模块(MPM)，基本模块(Base)，扩展模块(Extension)，实验性模块(Experimental)，第三方模块(External)。<br />
关于各模块的状态详情可以查看手册。第三方模块不包含在发行版中，手册中只标识了四种状态：</p>
<table border="1" cellspacing="0" cellpadding="0" bordercolor="#aaaaaa">
<tbody>
<tr>
<th>M</th>
<td>多路处理模块</td>
<td>必须有且仅有一个MPM被静态编译到服务器中。</td>
</tr>
<tr>
<th>B</th>
<td>基本模块</td>
<td>默认包含，必须明确禁用。</td>
</tr>
<tr>
<th>E</th>
<td>扩展模块</td>
<td>默认不包含，必须明确启用。</td>
</tr>
<tr>
<th>X</th>
<td>试验模块</td>
<td>默认不包含，必须明确启用。</td>
</tr>
</tbody>
</table>
<h2>Apache的基本模块</h2>
<p>Apache 2.2.14 默认被静态编译进httpd的模块：</p>
<h3>核心模块</h3>
<p>不可或缺<br />
core.c<br />
http_core.c<br />
mod_so.c<br />
prefork.c（Linux上默认是prefork.c）</p>
<h3>认证相关模块</h3>
<p>mod_authn_file.c<br />
mod_authn_default.c<br />
mod_authz_host.c<br />
mod_authz_groupfile.c<br />
mod_authz_user.c<br />
mod_authz_default.c<br />
mod_auth_basic.c</p>
<h3>其它模块</h3>
<p>mod_include.c<br />
mod_filter.c<br />
mod_log_config.c<br />
mod_env.c<br />
mod_setenvif.c<br />
mod_version.c<br />
mod_mime.c<br />
mod_status.c<br />
mod_autoindex.c<br />
mod_asis.c<br />
mod_cgi.c<br />
mod_negotiation.c<br />
mod_dir.c<br />
mod_actions.c<br />
mod_userdir.c<br />
mod_alias.c</p>
<h2>我的Apache的常用模块</h2>
<h3>最简单的认证模块组合</h3>
<p>[B]mod_auth_basic.c 或<br />
[E]mod_auth_digest.c 加 (2.2.14版时，已经由实验模块转为扩展模块)<br />
[B]mod_authn_file.c 加<br />
[B]mod_authz_user.c<br />
注意！basic加密方式密码是明文传送的，不安全，建议使用digest方式的认证。</p>
<h3>保护认证而加载的模块</h3>
<p>[B]mod_authn_default.c<br />
[B]mod_authz_default.c<br />
出于安全考虑，强烈建议加载！</p>
<h3>最常用的访问控制模块</h3>
<p>[B]mod_authz_host.c<br />
提供基与主机名、IP地址以及请求特征的访问控制。</p>
<h3>其它常用模块</h3>
<p>[B]mod_log_config.c<br />
[B]mod_alias.c<br />
[B]mod_dir.c<br />
[B]mod_mime.c<br />
[B]mod_setenvif.c<br />
[E]mod_rewrite.c<br />
[E]mod_deflate.c<br />
[E]mod_expires.c<br />
[E]mod_headers.c</p>
<h2>我常用的编译指令</h2>
<p><code><br />
1. ./configure --prefix=/opt/httpd-2.2.14 --with-mpm=prefork --enable-mods-shared=all LDFLAGS='-s'<br />
2. ./configure --prefix=/opt/httpd-2.2.14 --with-mpm=prefork --enable-mods-shared=all --enable-cache --enable-mem-cache --enable-ssl --enable-file-cache --enable-disk-cache --enable-proxy --enable-proxy-http LDFLAGS='-s'<br />
3. ./configure  --prefix=/opt/httpd-2.2.14 --with-mpm=prefork --enable-mods-shared=all --enable-dir=static --enable-authz-host=static --enable-auth-basic=static --enable-authn_file=static --enable-authz_user=static --enable-authn-default=static --enable-authz-default=static --enable-setenvif=static --enable-alias=static --enable-log-config=static --enable-deflate=static --enable-rewrite=static --enable-mime=static --enable-expires=static --enable-cache=static --enable-mem-cache=static --enable-headers=shared --enable-disk-cache=shared --enable-file-cache=shared LDFLAGS='-s'<br />
</code><br />
注意：因为Apache的./configure生成的Makefile不支持make install-strip，所以使用 LDFLAGES=&#8217;-s&#8217;来编译被strip的代码。</p>
<p>参考：<br />
<a href="http://www.bsdmap.com/articles/linux/inside_config_compile_install.html" target="_blank">深入理解软件包的配置、编译与安装</a><br />
<a href="http://www.bsdmap.com/manuals/Apache/install.html" target="_blank">Apache 2.2 手册-编译与安装</a><br />
<a href="http://www.bsdmap.com/manuals/Apache/dso.html" target="_blank">Apache 2.2 手册-动态共享对象支持</a><br />
<a href="http://www.bsdmap.com/manuals/Apache/mod/index.html" target="_blank">Apache 2.2 手册-各模块的简介描述</a><br />
<a href="http://www.bsdmap.com/manuals/Apache/mod/module-dict.html" target="_blank">Apache 2.2 手册-描述模块的术语</a><br />
<a href="http://www.bsdmap.com/manuals/Apache/mod/quickreference.html" target="_blank">Apache 2.2 手册-指令速查</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/03/compile-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_authn_default 和 mod_authz_default</title>
		<link>http://www.bsdmap.com/2010/02/03/mod_authn_default-and-mod_authz_default/</link>
		<comments>http://www.bsdmap.com/2010/02/03/mod_authn_default-and-mod_authz_default/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 06:04:36 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_authn_defaul]]></category>
		<category><![CDATA[mod_authz_default]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1715</guid>
		<description><![CDATA[mod_authn_default 该模块是一个失败补救(fallback)模块，它在未正确配置认证模块(比如mod_auth_basic缺失mod_authz_user模块的，语法检查检查不出来)的情况下简单拒绝一切认证信息。起到保护数据的作用。 mod_authz_default 在未正确配置授权支持模块的情况下简单拒绝一切授权请求。同样起到保护数据的作用。 假如没有加载default模块，那么，错误的认证配置，会使服务端产生一个500状态码，默认情况下，会生成一个“The server encountered an internal error or misconfiguration and was unable to complete your request.”的提示，有助于管理员调试。 假如加载了default模块，那么错误的认证配置，会使客户端始终不能通过认证，最终返回一个401状态码。 出于安全考虑，这两个模块在启用认证的情况下，一定要加载！]]></description>
			<content:encoded><![CDATA[<p><strong>mod_authn_default</strong><br />
该模块是一个失败补救(fallback)模块，它在未正确配置认证模块(比如mod_auth_basic缺失mod_authz_user模块的，语法检查检查不出来)的情况下简单拒绝一切认证信息。起到保护数据的作用。</p>
<p><strong>mod_authz_default</strong><br />
在未正确配置授权支持模块的情况下简单拒绝一切授权请求。同样起到保护数据的作用。</p>
<p>假如没有加载default模块，那么，错误的认证配置，会使服务端产生一个500状态码，默认情况下，会生成一个“The server encountered an internal error or misconfiguration and was unable to complete your request.”的提示，有<strong>助于管理员调试</strong>。</p>
<p>假如加载了default模块，那么错误的认证配置，会使客户端始终不能通过认证，最终返回一个401状态码。</p>
<p><strong>出于安全考虑，这两个模块在启用认证的情况下，一定要加载！</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/03/mod_authn_default-and-mod_authz_default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>修改Apache的Max open files限制</title>
		<link>http://www.bsdmap.com/2010/02/01/apache-max-open-files/</link>
		<comments>http://www.bsdmap.com/2010/02/01/apache-max-open-files/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 16:17:59 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[关键性技巧]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[nofile]]></category>
		<category><![CDATA[ulimit]]></category>
		<category><![CDATA[习惯]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1625</guid>
		<description><![CDATA[相信绝大多数人，都是直接对 /etc/security/limits.conf  文件进行的修改，添加类似下面的两行： *     soft         nofile           10240 *     hard       nofile           10240 这样也能达到效果。但是经验告诉我，能在局部修改，就不要动全局——因为我们不好评估全局会对哪些应用造成影响（就修改nofile参数一事来说，目前还没有发现修改全局对系统的明显影响，但是理论上可以肯定，将全局的限制放宽，意味着使系统容易受到“资源耗尽”类的攻击，然而在我的工作经历中，还没有遇到一例类似事故发生过），所以我建议将这些局部性的修改放到各自的启动脚本里。 在apachectl脚本里，有这样的语句： # # Set this variable to a command that increases the maximum # number of file descriptors allowed per child process. This is # critical for configurations that use many file descriptors, # such as mass vhosting, or a multithreaded server. ULIMIT_MAX_FILES=&#8221;ulimit -S -n `ulimit [...]]]></description>
			<content:encoded><![CDATA[<p>相信绝大多数人，都是直接对 /etc/security/limits.conf  文件进行的修改，添加类似下面的两行：</p>
<p>*     soft         nofile           10240<br />
*     hard       nofile           10240</p>
<p>这样也能达到效果。<strong>但是经验告诉我，能在局部修改，就不要动全局</strong>——因为我们不好评估全局会对哪些应用造成影响（就修改nofile参数一事来说，目前还没有发现修改全局对系统的明显影响，但是理论上可以肯定，将全局的限制放宽，意味着使系统容易受到“资源耗尽”类的攻击，然而在我的工作经历中，还没有遇到一例类似事故发生过），<strong>所以我建议将这些局部性的修改放到各自的启动脚本里。</strong></p>
<p>在apachectl脚本里，有这样的语句：</p>
<p>#<br />
# Set this variable to a command that increases the maximum<br />
# number of file descriptors allowed per child process. This is<br />
# critical for configurations that use many file descriptors,<br />
# such as mass vhosting, or a multithreaded server.<br />
ULIMIT_MAX_FILES=&#8221;ulimit -S -n `ulimit -H -n`&#8221;<br />
# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;                              &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||</p>
<p># Set the maximum number of file descriptors allowed per child process.<br />
if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then<br />
    $ULIMIT_MAX_FILES<br />
fi</p>
<p>所以，我推荐直接修改apachectl，在ULIMIT_MAX_FILES=&#8221;ulimit -S -n `ulimit -H -n`&#8221; 之前，设定nofile的“硬限制”，如下：</p>
<p># number of file descriptors allowed per child process. This is<br />
# critical for configurations that use many file descriptors,<br />
# such as mass vhosting, or a multithreaded server.<br />
<span style="color: #ff0000;">ulimit -H -n 5000</span><br />
ULIMIT_MAX_FILES=&#8221;ulimit -S -n `ulimit -H -n`&#8221;<br />
# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;                              &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||</p>
<p># Set the maximum number of file descriptors allowed per child process.<br />
if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then<br />
    $ULIMIT_MAX_FILES<br />
fi</p>
<p><strong>这样修改的好处在于，只有Apache的“nofile”受到影响，不影响其它。<br />
</strong>原公司的所有应用的管理脚本中（apachectl、nginxctl），都进行了修改，并且使用&#8221;isystem&#8221;（自己写的一套脚本、小程序的集合）进行统一管理，以至于到后来，我几乎已经忘掉了这些事情，但是系统仍然运行良好，没有再出过 &#8220;too many open files&#8221; 的问题。</p>
<p><strong>注意：修改过nofile的hard限制以后，需要先stop，再start，httpd进程的限制才能使用新改的参数。</strong></p>
<p>查看当前运行中的进程的limit信息，可以利用/proc（当前Linux内存为2.6），比如apache的一个进程号是10232：</p>
<p>cat /proc/10232/limits</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/01/apache-max-open-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache的认证</title>
		<link>http://www.bsdmap.com/2010/02/01/apache-auth-basic/</link>
		<comments>http://www.bsdmap.com/2010/02/01/apache-auth-basic/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 07:40:32 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Auth]]></category>
		<category><![CDATA[AuthType]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1578</guid>
		<description><![CDATA[Apache的认证模型 Apache的认证模块分成三个部分：认证类型模块，认证支持模块，认证授权模块。 认证类型模块(auth)： mod_auth_basic mod_auth_digest 认证支持模块(authn)： mod_authn_alias mod_authn_anon mod_authn_file mod_authn_dbd mod_authn_dbm mod_authn_default mod_authnz_ldap 认证授权模块(authz)： mod_authnz_ldap mod_authz_dbm mod_authz_default mod_authz_user mod_authz_groupfile mod_authz_owner 注意： mod_authnz_ldap模块即包含认证功能也提供授权功能。mod_authn_alias本身并实现认证功能，但是允许其它认证支持模块以更灵活的方式进行配置。 mod_authz_host 模块提供基于主机名、IP地址、请求特征的访问控制，但并不属于认证支持系统。 一般常用的AuthType 是&#8221;Basic/Digest&#8221;，这个认证需要用到认证模块mod_auth_basic/mod_auth_digest，和认证支持模块mod_authn_file和认证授权模块mod_authz_user。 就是说，最常用的认证组合方式是： mod_auth_basic/mod_auth_digest     + mod_authn_file     + mod_authz_user 即是说，一个使用认证以及访问控制（支持Order Allow,Deny ,Allow from all这样的指令）Apache系统，至少要用到下面四或者五个模块： mod_auth_basic/mod_auth_digest     + mod_authn_file     + mod_authz_user     + mod_authz_host 不太熟悉Apache认证的管理员，为了优化Apache占用的内存，往往会注释掉一些用不到的模块，而又因为不明白认证模块之间的关系，而导致认证总是不能成功，而apache（目前我使用的版本：2.2.3）的语法检查检查不出来mod_authz_user模块的缺失，故常常使管理员困惑。 重要提醒： Basic认证类型不加密来自用户浏览器的密码，因此不应该用于保护敏感数据。对于敏感的数据，应使用Digest方式来进行认证（比较老的浏览器不支持，不过时至今日，应该已经不是问题了）。 参考：http://www.bsdmap.com/UNIX_html/ApacheMenu_zh_CN/howto/auth.html]]></description>
			<content:encoded><![CDATA[<p><strong>Apache的认证模型</strong></p>
<p>Apache的认证模块分成三个部分：认证类型模块，认证支持模块，认证授权模块。</p>
<p style="padding-left: 30px;"><strong>认证类型模块(auth)：</strong><br />
mod_auth_basic<br />
mod_auth_digest</p>
<p style="padding-left: 30px;"><strong>认证支持模块(authn)：<br />
</strong>mod_authn_alias<br />
mod_authn_anon<br />
mod_authn_file<br />
mod_authn_dbd<br />
mod_authn_dbm<br />
mod_authn_default<br />
mod_authnz_ldap</p>
<p style="padding-left: 30px;"><strong>认证授权模块(authz)：<br />
</strong>mod_authnz_ldap<br />
mod_authz_dbm<br />
mod_authz_default<br />
mod_authz_user<br />
mod_authz_groupfile<br />
mod_authz_owner</p>
<p style="padding-left: 30px;">注意：<br />
mod_authnz_ldap模块即包含认证功能也提供授权功能。mod_authn_alias本身并实现认证功能，但是允许其它认证支持模块以更灵活的方式进行配置。<br />
mod_authz_host 模块提供基于主机名、IP地址、请求特征的访问控制，但并不属于认证支持系统。</p>
<p>一般常用的AuthType 是&#8221;Basic/Digest&#8221;，这个认证需要用到认证模块mod_auth_basic/mod_auth_digest，和认证支持模块mod_authn_file和认证授权模块mod_authz_user。</p>
<p><strong>就是说，最常用的认证组合方式是：<br />
mod_auth_basic/mod_auth_digest<br />
    +<br />
mod_authn_file<br />
    +<br />
mod_authz_user</strong></p>
<p>即是说，一个使用认证以及访问控制（支持Order Allow,Deny ,Allow from all这样的指令）Apache系统，至少要用到下面四或者五个模块：<br />
mod_auth_basic/mod_auth_digest<br />
    +<br />
mod_authn_file<br />
    +<br />
mod_authz_user<br />
    +<br />
mod_authz_host</p>
<p>不太熟悉Apache认证的管理员，为了优化Apache占用的内存，往往会注释掉一些用不到的模块，而又因为不明白认证模块之间的关系，而导致认证总是不能成功，而apache（目前我使用的版本：2.2.3）的语法检查检查不出来mod_authz_user模块的缺失，故常常使管理员困惑。</p>
<p><strong><span style="color: #ff0000;">重要提醒</span>：<br />
Basic认证类型不加密来自用户浏览器的密码，因此不应该用于保护敏感数据。对于敏感的数据，应使用Digest方式来进行认证（比较老的浏览器不支持，不过时至今日，应该已经不是问题了）。</strong></p>
<p>参考：<a href="http://www.bsdmap.com/UNIX_html/ApacheMenu_zh_CN/howto/auth.html">http://www.bsdmap.com/UNIX_html/ApacheMenu_zh_CN/howto/auth.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/01/apache-auth-basic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>快速了解Apache环境</title>
		<link>http://www.bsdmap.com/2010/02/01/apache-view/</link>
		<comments>http://www.bsdmap.com/2010/02/01/apache-view/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 06:55:21 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1580</guid>
		<description><![CDATA[当前使用的Apache的版本为2.2.3，支持以下使用方式： apachectl -v apachectl -V apachectl -l apachectl -L apachectl -S apachectl -M apachectl -V 1. 查看Server version。 2. 查看编译时间。 3. APR 及 APR-Util 的版本。 4. 硬件架构/平台（64-bit/32-bit） 5. 查看 Server MPM（Prefort/Worker） 6. 是否支持线程（threaded） 7. 定位 HTTPD_ROOT 8. 定位配置文件 9. …… apachectl -l 静态编译进httpd程序的模块。比如： Compiled in modules: core.c prefork.c http_core.c mod_so.c 这个命令也可以用来查看 Server MPM，一般情况下，要么是prefork.c，要么是worker.c。 apachectl -L [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #993366;">当前使用的Apache的版本为2.2.3，支持以下使用方式：<br />
apachectl -v<br />
apachectl -V<br />
apachectl -l<br />
apachectl -L<br />
apachectl -S<br />
apachectl -M</span></strong></p>
<p><strong><span style="color: #0000ff;">apachectl -V</span></strong></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">1. 查看Server version。</span><br />
2. 查看编译时间。<br />
3. APR 及 APR-Util 的版本。<br />
<span style="color: #ff0000;">4. 硬件架构/平台（64-bit/32-bit）</span><br />
<span style="color: #ff0000;">5. 查看 Server MPM（Prefort/Worker）<br />
</span>6. 是否支持线程（threaded）<br />
<span style="color: #ff0000;">7. 定位 HTTPD_ROOT</span><br />
8. 定位配置文件<br />
9. ……</p>
<p><strong><span style="color: #0000ff;">apachectl -l</span></strong></p>
<p style="padding-left: 30px;">静态编译进httpd程序的模块。比如：<br />
Compiled in modules:<br />
core.c<br />
prefork.c<br />
http_core.c<br />
mod_so.c<br />
这个命令也可以用来查看 Server MPM，一般情况下，要么是prefork.c，要么是worker.c。</p>
<p><strong><span style="color: #0000ff;">apachectl -L</span></strong></p>
<p style="padding-left: 30px;">查看目前Apache支持的指令，其中不包括加载模块后模块支持的指令。<br />
apachectl -L | grep ^[A-Z]</p>
<p><strong><span style="color: #0000ff;">apachectl -S / apachectl -t -D DUMP_VHOSTS</span></strong></p>
<p style="padding-left: 30px;">查看Apache下配置的虚拟主机情况。注间这里的“default server”是有特殊作用的。有时候我们需要专门统过调整Vhost配置段的位置或者vhosts配置文件被加载的顺序来调整、设立“default server”。</p>
<p><strong><span style="color: #0000ff;">apachectl -M / apachectl -t -D DUMP_MODULES</span></strong></p>
<p style="padding-left: 30px;">查看apache目前配置里加载的模块。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2010/02/01/apache-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache关闭ETag头儿</title>
		<link>http://www.bsdmap.com/2009/05/11/apache-etag/</link>
		<comments>http://www.bsdmap.com/2009/05/11/apache-etag/#comments</comments>
		<pubDate>Sun, 10 May 2009 17:50:03 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Etag]]></category>
		<category><![CDATA[FileETag]]></category>
		<category><![CDATA[header]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1325</guid>
		<description><![CDATA[在主配置文件段里添加了 FileETag None 但实际上并不总是有效，原因还没有找到。于是使用下面的方式： &#60;IfModule mod_headers.c&#62; header unset Etag &#60;/IfModule&#62; 可行。]]></description>
			<content:encoded><![CDATA[<p>在主配置文件段里添加了</p>
<p>FileETag None</p>
<p>但实际上并不总是有效，原因还没有找到。于是使用下面的方式：</p>
<p>&lt;IfModule mod_headers.c&gt;<br />
header unset Etag<br />
&lt;/IfModule&gt;</p>
<p>可行。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2009/05/11/apache-etag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将Apache的日志发送到syslog服务器</title>
		<link>http://www.bsdmap.com/2009/05/03/send-apache-logs-to-syslogd/</link>
		<comments>http://www.bsdmap.com/2009/05/03/send-apache-logs-to-syslogd/#comments</comments>
		<pubDate>Sun, 03 May 2009 06:05:05 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SHELL]]></category>
		<category><![CDATA[apache日志]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[syslog]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1279</guid>
		<description><![CDATA[一直想要统一收集管理Apache的日志，一来可以较实时的分析系统的负载情况、分析系统问题，另一个，也可以把收集日志的工作分散到平时，分散带宽使用，并且解决日志合并问题。 想到的解决方法主要有两个： 第一，使用haproxy。 haproxy本身刚好就支持将日志以udp的方式发送给syslog服务器。看上去完美、感觉上官方。 第二，使用/bin/logger。 这个，是我晚上发梦的时候想到的。试图将CustomLog 管道给/bin/logger，再由本地的syslog forward到远程统一的syslog服务器上。实验了一下，居然成功了。就是绕了那么一道弯子，感觉不太完美。 PS: 发布之后，自己搜了一下，发现了下文：http://www.lslnet.com/linux/dosc1/32/linux-247167.htm 解决方法倒也差不多，不过多了些详细的描述，很实用。 并且要注意：至少默认的syslog配置会将短时候内重复的日志记录给于提示，并不记录： May  3 14:31:51 localhost last message repeated 99 times 另外，将nginx的日志发送到syslog： mkfifo  /srv/logs/access_log.fifo 将 nginx 的日志写到这个 管道文件上 然后：logger -f /srv/logs/access_log.fifo 即可。]]></description>
			<content:encoded><![CDATA[<p>一直想要统一收集管理Apache的日志，一来可以较实时的分析系统的负载情况、分析系统问题，另一个，也可以把收集日志的工作分散到平时，分散带宽使用，并且解决日志合并问题。</p>
<p>想到的解决方法主要有两个：</p>
<p>第一，使用haproxy。</p>
<p>haproxy本身刚好就支持将日志以udp的方式发送给syslog服务器。看上去完美、感觉上官方。</p>
<p>第二，使用/bin/logger。</p>
<p>这个，是我晚上发梦的时候想到的。试图将CustomLog 管道给/bin/logger，再由本地的syslog forward到远程统一的syslog服务器上。实验了一下，居然成功了。就是绕了那么一道弯子，感觉不太完美。</p>
<p>PS:</p>
<p>发布之后，自己搜了一下，发现了下文：http://www.lslnet.com/linux/dosc1/32/linux-247167.htm</p>
<p>解决方法倒也差不多，不过多了些详细的描述，很实用。</p>
<p>并且要注意：至少默认的syslog配置会将短时候内重复的日志记录给于提示，并不记录：</p>
<p>May  3 14:31:51 localhost last message repeated 99 times</p>
<p>另外，将nginx的日志发送到syslog：</p>
<p>mkfifo  /srv/logs/access_log.fifo</p>
<p>将 nginx 的日志写到这个 管道文件上</p>
<p>然后：logger -f /srv/logs/access_log.fifo 即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2009/05/03/send-apache-logs-to-syslogd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用基于Apache的 subversion/svn 管理代码</title>
		<link>http://www.bsdmap.com/2009/04/25/httpd-mod_dav_svn/</link>
		<comments>http://www.bsdmap.com/2009/04/25/httpd-mod_dav_svn/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 05:32:56 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[apahce]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod_dav_svn]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svn加密]]></category>
		<category><![CDATA[加密svn密码]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1118</guid>
		<description><![CDATA[到版本1.5.6，subversion提供的svnserve搭建的SVN服务器，使用的仍然是名文密码文件。 为了使用加密的密码文件，需要借助于Apache，使用subversion的mod_dav_svn和mod_authz_svn.so，使用基于Apache的认证机制。 假如使用发行版的Apache，那么一般发行版都带了相应的svn模块mod_dav_svn（CentOS）、libapache2-svn（Debian／Ubantu），直接安装即可。 下面主要介绍 源代码安装mod_dav_svn： 下载subversion的源代码：http://subversion.tigris.org/ 与Apaceh相关的两个编译选择： &#8211;with-apxs[=FILE]      Build shared Apache modules. FILE is the optional pathname to the Apache apxs tool; defaults to &#8220;apxs&#8221;. &#8211;with-apache-libexecdir[=PATH] Install Apache modules to PATH instead of Apache&#8217;s configured modules directory; PATH &#8220;no&#8221; or &#8211;without-apache-libexecdir means install to LIBEXECDIR. 一般指定使用 &#8211;with-apxs=［apxs的绝对路径]来编译。默认会安装两个模块到Apache的modules目录内，分别mod_authz_svn.so、mod_dav_svn.so。 配置Apache： 1. 加载SVN依赖的模块 LoadModule dav_module             modules/mod_dav.so LoadModule dav_fs_module         [...]]]></description>
			<content:encoded><![CDATA[<p>到版本1.5.6，subversion提供的svnserve搭建的SVN服务器，使用的仍然是名文密码文件。</p>
<p>为了使用加密的密码文件，需要借助于Apache，使用subversion的<em>mod_dav_svn</em>和<em>mod_authz_svn.so</em>，使用基于Apache的认证机制。</p>
<p>假如使用发行版的Apache，那么一般发行版都带了相应的svn模块mod_dav_svn（CentOS）、libapache2-svn（Debian／Ubantu），直接安装即可。</p>
<p>下面主要介绍</p>
<p><strong>源代码</strong><strong>安装mod_dav_svn：</strong></p>
<p>下载subversion的源代码：http://subversion.tigris.org/</p>
<p>与Apaceh相关的两个编译选择：</p>
<p>&#8211;with-apxs[=FILE]      Build shared Apache modules. FILE is the optional pathname to the Apache apxs tool; defaults to &#8220;apxs&#8221;.<br />
&#8211;with-apache-libexecdir[=PATH] Install Apache modules to PATH instead of Apache&#8217;s configured modules directory; PATH &#8220;no&#8221; or &#8211;without-apache-libexecdir means install to LIBEXECDIR.</p>
<p>一般指定使用 &#8211;with-apxs=［apxs的绝对路径]来编译。默认会安装两个模块到Apache的modules目录内，分别mod_authz_svn.so、mod_dav_svn.so。</p>
<p><strong>配置Apache：</strong></p>
<p>1. 加载SVN依赖的模块</p>
<p>LoadModule dav_module             modules/mod_dav.so<br />
LoadModule dav_fs_module         modules/mod_dav_fs.so<br />
LoadModule dav_svn_module       modules/mod_dav_svn.so<br />
LoadModule authz_svn_module    modules/mod_authz_svn.so</p>
<p>2. 建立svn仓库</p>
<p>svnadmin create /srv/_svndata/isystem<br />
svnadmin create /srv/_svndata/iconfig</p>
<p>3. 配置apache对svn仓库的管理<br />
# 注意，/svn目录不能在你的DocumentRoot目录下。<br />
&lt;Location /svn&gt;<br />
# 启用SVN<br />
DAV svn<br />
# 设置SVN仓库的路径<br />
# SVNPath /srv/_svndata/isystem<br />
# 假如在一个目录下有多个仓库，那么可以使用SVNParentPath来指定多仓库的根目录<br />
# 也可以使用SVNPath来进行单独的设置<br />
SVNParentPath /srv/_svndata</p>
<p>AuthType Basic<br />
AuthName &#8220;Subversion Repository&#8221;<br />
AuthUserFile /etc/apache2/dav_svn.passwd</p>
<p># 设置SVN的权限控制<br />
AuthzSVNAccessFile /etc/apache2/dav_svn.authz</p>
<p>&lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;<br />
Require valid-user<br />
&lt;/LimitExcept&gt;</p>
<p>&lt;/Location&gt;</p>
<p>4. 添加SVN访问账号</p>
<p>htpasswd /etc/apache2/dav_svn.passwd  caoyuwei</p>
<p>编辑：/etc/apache2/dav_svn.authz</p>
<p>[groups]<br />
admin = caoyuwei<br />
[/]<br />
@admin = rw<br />
[isystem:/]<br />
@admin= rw<br />
[iconfig:/]<br />
@admin=rw</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2009/04/25/httpd-mod_dav_svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用ssl加密http协议</title>
		<link>http://www.bsdmap.com/2009/03/25/apache-openssl-ssl-mod_ssl/</link>
		<comments>http://www.bsdmap.com/2009/03/25/apache-openssl-ssl-mod_ssl/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 02:24:47 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=1109</guid>
		<description><![CDATA[使用mod_ssl模块，使Apache可以使用SSL协议加密HTTP协议，用来保护HTTP会话。 最简洁的配置样例： &#60;VirtualHost _default_:443&#62; ServerName    www.bsdmap.com DocumentRoot  /opt/httpd/htdocs SSLEngine      on SSLCertificateFile        /opt/httpd/conf/ssl/www.bsdmap.com.cert SSLCertificateKeyFile   /opt/httpd/conf/ssl/www.bsdmap.com.key &#60;/VirtualHost&#62; SSLEngine                 ON 启动SSL引擎 SSLCertificateFile       指定证书 SSLCertificateKeyFile  指定相关密钥 使用SSL加密分为正式场合，比如网上银行、支付宝等对应用安全要求较高的应用上；另一个为非正试场合，比如自己也可以配置一个SSL的web服务。区别在于，正式场合https应用使用的SSL证书是经过第三方数字签名的，而非正式应用，则是非正式机构或者是自己制作、签名的。 成生密钥对儿： 在创建证书之前，要有一个共公／私有密钥对儿。以www.bsdmap.com为例： openssl genrsa -des3 -rand file1:file2:file3 -out www.bsdmap.com.key 1024 genrsa：告诉openssl要生成一个RSA的密钥对儿。 des3：表示私钥应该被一个&#8221;pass phrase&#8221;编码和保护。 rand：给OpenSSL提供任意的、随机的数据以确保生成的密钥是唯一的和不可预知的。这个开关在Windows里没有必要，在Windows下使用其他的方式获得随机数据。 out：保存位置。 1024：密钥位数。 当使用了-des3选项，成生了受“口令”保护的密钥对儿时，启动apache时需要输入口令才能启动。假如不想要每次都输入“口令”（不安全），可以使用不受“口令”保护的密钥，去掉-des3选项即可，也可以使用下面的命令转换一下： openssl rsa -in www.bsdmap.com.key -out www.bsdmap.com.key.nopassword 显示密钥文件的信息： openssl rsa -noout -text -in www.bsdmap.com.key 该命令也可用于查看ssh-key的信息，其实质是一样的。   [...]]]></description>
			<content:encoded><![CDATA[<p>使用mod_ssl模块，使Apache可以使用SSL协议加密HTTP协议，用来保护HTTP会话。</p>
<p><span style="color: #ff0000;"><strong>最简洁的配置样例：</strong></span></p>
<p>&lt;VirtualHost _default_:443&gt;<br />
ServerName    www.bsdmap.com<br />
DocumentRoot  /opt/httpd/htdocs<br />
SSLEngine      on<br />
SSLCertificateFile        /opt/httpd/conf/ssl/www.bsdmap.com.cert<br />
SSLCertificateKeyFile   /opt/httpd/conf/ssl/www.bsdmap.com.key<br />
&lt;/VirtualHost&gt;</p>
<p>SSLEngine                 ON 启动SSL引擎<br />
SSLCertificateFile       指定证书<br />
SSLCertificateKeyFile  指定相关密钥</p>
<p>使用SSL加密分为正式场合，比如网上银行、支付宝等对应用安全要求较高的应用上；另一个为非正试场合，比如自己也可以配置一个SSL的web服务。区别在于，正式场合https应用使用的SSL证书是经过第三方数字签名的，而非正式应用，则是非正式机构或者是自己制作、签名的。</p>
<p><span style="color: #ff0000;"><strong>成生密钥对儿：</strong></span></p>
<p>在创建证书之前，要有一个共公／私有密钥对儿。以www.bsdmap.com为例：</p>
<p><strong>openssl genrsa -des3 -rand file1:file2:file3 -out www.bsdmap.com.key 1024</strong></p>
<p>genrsa：告诉openssl要生成一个RSA的密钥对儿。</p>
<p>des3：表示私钥应该被一个&#8221;pass phrase&#8221;编码和保护。</p>
<p>rand：给OpenSSL提供任意的、随机的数据以确保生成的密钥是唯一的和不可预知的。这个开关在Windows里没有必要，在Windows下使用其他的方式获得随机数据。</p>
<p>out：保存位置。</p>
<p>1024：密钥位数。</p>
<p>当使用了-des3选项，成生了受“口令”保护的密钥对儿时，启动apache时需要输入口令才能启动。假如不想要每次都输入“口令”（不安全），可以使用不受“口令”保护的密钥，去掉-des3选项即可，也可以使用下面的命令转换一下：</p>
<p><strong>openssl rsa -in www.bsdmap.com.key -out www.bsdmap.com.key.nopassword</strong></p>
<p>显示密钥文件的信息：</p>
<p><strong>openssl rsa -noout -text -in www.bsdmap.com.key</strong></p>
<p>该命令也可用于查看ssh-key的信息，其实质是一样的。</p>
<p><strong> </strong></p>
<p><span style="color: #ff0000;"><strong>创建一个证书签署请求（正式应用场合）：</strong></span></p>
<p>正式场合的应用，需要一个经证书颁发机构签署的证书，为此，我们先成生一个证书，提交由第三机构签名认证。使用命令：</p>
<p><strong>openssl req -new -key www.bsdmap.com.key -out www.bsdmap.com.csr</strong></p>
<p>需要填写一些地域、组织机构类的信息。需要特殊说明的是：在一个网站站书里，Common Name (eg, YOUR name)一栏标识完全限定的域名（FQDN），假如此处与以后使用证书的站点名不同，浏览器将发布一个错误，无法访问。</p>
<p>完成之后，证书就存储在www.bsdmap.com.csr里。下面的命令可以显示这个证书的信息：</p>
<p><strong>openssl req -noout -text -in www.bsdmap.com.csr</strong></p>
<p>然后，可以所这个证书签署请求提交给一个CA（证书签署机构）处理。</p>
<p>Verisign和Thawte是两家可以选择的CA：</p>
<p>https://digitalid.verisign.com/server/apacheNotice.htm</p>
<p>https://www.thawte.com/ssl-digital-certificates/buy-ssl-certificates/</p>
<p><span style="color: #ff0000;"><strong>创建自签署证书（非正式应用场合）：</strong></span></p>
<p>非正式的应用，可以自己签署自己的证书：</p>
<p><strong>openssl x509 -req -days 365 -in www.bsdmap.com.csr -signkey www.bsdmap.com.key -out www.bsdmap.com.cert</strong></p>
<p>并且，必须使用：chmod 400 www.bsdmap.com.key　来保护密钥文件。</p>
<p><span style="color: #ff0000;"><strong>另一个问题：</strong></span></p>
<p>貌似SSL不能与基于主机名的虚拟主机一同工作。</p>
<p>有一个协议把一个已有的HTTP连接升级到TLS，但是并不是所有的浏览器支持此项功能（RFC 2817）。</p>
<p>参考：<br />
SSL原理解析</p>
<p>http://www.yesky.com/ServerIndex/77125243130347520/20040426/1791592.shtml</p>
<p>SSL原理解密</p>
<p>http://fanqiang.chinaunix.net/a6/b8/20010608/121000441.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2009/03/25/apache-openssl-ssl-mod_ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>服务器时间与HTTPD关系</title>
		<link>http://www.bsdmap.com/2009/03/01/httpd-time/</link>
		<comments>http://www.bsdmap.com/2009/03/01/httpd-time/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 12:17:04 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[时间]]></category>
		<category><![CDATA[时间与http]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=991</guid>
		<description><![CDATA[发现服务器时间与HTTP应用有关。 当服务器时间慢于标准时间时（也可能是服务器时间是Last-Modified时间的过去时间时），会导致客户端缓存失效，从而产生不必要的流量。]]></description>
			<content:encoded><![CDATA[<p>发现服务器时间与HTTP应用有关。</p>
<p>当服务器时间慢于标准时间时（也可能是服务器时间是Last-Modified时间的过去时间时），会导致客户端缓存失效，从而产生不必要的流量。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2009/03/01/httpd-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>二进制包还是源代码包</title>
		<link>http://www.bsdmap.com/2008/12/07/strip/</link>
		<comments>http://www.bsdmap.com/2008/12/07/strip/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 11:22:07 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[strip]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=874</guid>
		<description><![CDATA[我建议对“LAMP”构架应用不太熟悉的朋友直接使用系统提供的二进制代码安装——假如不是有什么特殊需求的话，比如领导强制要求必须使用最新版本的代码或者有特殊需求，比如有自己的“FHS”。其官方提供的二进制代码理论上是经过官方的技术人员的优化、以及多方测试的，甚至比不太熟悉的人用源代码编译得来的二进制，性能更高。随便说一下，这也是我觉得“服务器版”与“通用版本”之间可能存在的微弱或者重大的差别。并且，网上很多文章均使用源代码的方式安装程序，而很少有提及编译时strip代码的问题，这真是一个讽刺，对“优化”、“性能”如此注重之人，却使用包含着“symbols”（编译成生二进制程序时为调试和诊断而保留的非必需的结构）的二进制（strip之后，性能提高不敢乱言，至少文件大小会有惊人的变化：php-cgi strip之前12M，strip之后只有3M，无压力情况下，php-cgi占用的内存由5.5M降低到1.8M——数据仅供参考。），系统提供的二进制，绝大多数都是“striped”的（使用file命令可以查看到二进制文件的相关信息）——不敢妄言“全部”，因为隐约记得TSL（TSL是一个声称像OpenBSD一样安全的Linux系统）的系统上，发现过没有strip过的二进制，可能是谬误。 即然提到了strip，随便也说一下如何strip二进制，Linux提供了事后strip程序的工具“strip”命令： 1. 查看程序是否是&#8221;striped&#8221;的 file  /opt/httpd/bin/httpd 假如需要strip，那么 2. strip /opt/httpd/bin/httpd 即可！ 另外，其实编译代码的时候可以要求生成&#8221;striped&#8221;的代码，绝大多数开源代码，make里都提供了该参数，就是install-strip，即在编译完之后安装的时候，使用install-strip而不是install来strip程序再安装。  MySQL安装的时候使用make install-strip即可。 Apache要在./configure 时，加上 LDFLAGS=&#8217;-s&#8217;的选项即可。 PHP则需要在./configure之前，先执行一下export LDFLAGS=&#8217;-s&#8217; (bash环境）。 可以细读金步国的作品：深入理解软件包的配置、编译与安装。]]></description>
			<content:encoded><![CDATA[<p>我建议对“LAMP”构架应用不太熟悉的朋友直接使用系统提供的二进制代码安装——假如不是有什么特殊需求的话，比如领导强制要求必须使用最新版本的代码或者有特殊需求，比如有自己的“<a href="http://www.bsdmap.com/manuals/FHS/fhs-2.3.html" target="_blank">FHS</a>”。其官方提供的二进制代码理论上是经过官方的技术人员的优化、以及多方测试的，甚至比不太熟悉的人用源代码编译得来的二进制，性能更高。随便说一下，这也是我觉得“服务器版”与“通用版本”之间可能存在的微弱或者重大的差别。并且，网上很多文章均使用源代码的方式安装程序，而很少有提及编译时strip代码的问题，这真是一个讽刺，对“优化”、“性能”如此注重之人，却使用包含着“symbols”（编译成生二进制程序时为调试和诊断而保留的非必需的结构）的二进制（strip之后，性能提高不敢乱言，至少文件大小会有惊人的变化：php-cgi strip之前12M，strip之后只有3M，无压力情况下，php-cgi占用的内存由5.5M降低到1.8M——数据仅供参考。），系统提供的二进制，绝大多数都是“striped”的（使用file命令可以查看到二进制文件的相关信息）——不敢妄言“全部”，因为隐约记得<a href="http://www.trustix.org" target="_blank">TSL</a>（TSL是一个声称像OpenBSD一样安全的Linux系统）的系统上，发现过没有strip过的二进制，可能是谬误。</p>
<p>即然提到了strip，随便也说一下如何strip二进制，Linux提供了事后strip程序的工具“strip”命令：</p>
<p>1. 查看程序是否是&#8221;striped&#8221;的</p>
<p>file  /opt/httpd/bin/httpd</p>
<p>假如需要strip，那么</p>
<p>2. strip /opt/httpd/bin/httpd</p>
<p>即可！</p>
<p>另外，其实编译代码的时候可以要求生成&#8221;striped&#8221;的代码，绝大多数开源代码，make里都提供了该参数，就是install-strip，即在编译完之后安装的时候，使用install-strip而不是install来strip程序再安装。 </p>
<p>MySQL安装的时候使用make install-strip即可。</p>
<p>Apache要在./configure 时，加上 LDFLAGS=&#8217;-s&#8217;的选项即可。</p>
<p>PHP则需要在./configure之前，先执行一下export LDFLAGS=&#8217;-s&#8217; (bash环境）。</p>
<p>可以细读金步国的作品：<a title="深入理解软件包的配置、编译与安装" href="http://www.bsdmap.com/articles/linux/inside_config_compile_install.html" target="_blank">深入理解软件包的配置、编译与安装</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2008/12/07/strip/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LAMP架构中的关键瓶颈在哪里</title>
		<link>http://www.bsdmap.com/2008/09/03/lamp/</link>
		<comments>http://www.bsdmap.com/2008/09/03/lamp/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 04:00:03 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/?p=465</guid>
		<description><![CDATA[以下为引用： 我的想法源起于这样一个事情，有一次一个网站的技术总监问我，为什么他们的网站那么慢，要怎么办。当时，我的MSN里Zend总部的工程师正好在线，我就 问他PHP响应比较慢了，怎么办？他当时直接告诉我，数据库问题！肯定是数据库没有优化设计好。所以，我没有给那个技术总监确切的答案了，因为他们的数据 库设计我们是不能涉及的。所以就给了大概的数据库优化的建议。这样的事情屡次发生，我就开始怀疑，为什么Zend总部的工程师每次都跟我 说是数据库的问题呢，难道我们不能从PHP层面来解决这个问题吗？答案是不能！因为PHP目前的运行速度已经是很快了，通过Zend的性能分析也能看到一 个用户的点击，PHP的运行时间只有10%不到，那PHP在干吗？它在等。等数据库的查询结果。这个方面在目前的PHP产品中有了很大 的提高，那就是Caching和网页静态化两个方案。Caching可能大家会比较陌生，但是网也静态化现在连PHP产品的用户都非常清楚了。速度快、容 易被搜索到等等，好处不言而喻。开玩笑地说，现在网站的主页实现网页静态化只需要硬盘足够大。至于Caching就比较复杂些，也是大多数PHPer感到 头疼的地方。甚至于有些人会用C来实现。因为Caching中的数据有效期验证、查找、提取、更新等等都是比较难处理。当然，也有人会用数据库来处理 Caching问题。]]></description>
			<content:encoded><![CDATA[<p>以下为引用：</p>
<p>我的想法源起于这样一个事情，有一次一个网站的技术总监问我，为什么他们的网站那么慢，要怎么办。当时，我的MSN里Zend总部的工程师正好在线，我就 问他PHP响应比较慢了，怎么办？他当时直接告诉我，数据库问题！肯定是数据库没有优化设计好。所以，我没有给那个技术总监确切的答案了，因为他们的数据 库设计我们是不能涉及的。所以就给了大概的数据库优化的建议。<strong>这样的事情屡次发生，我就开始怀疑，为什么Zend总部的工程师每次都跟我 说是数据库的问题呢，难道我们不能从PHP层面来解决这个问题吗？答案是不能！因为PHP目前的运行速度已经是很快了，通过Zend的性能分析也能看到一 个用户的点击，PHP的运行时间只有10%不到，那PHP在干吗？它在等。等数据库的查询结果。</strong>这个方面在目前的PHP产品中有了很大 的提高，那就是Caching和网页静态化两个方案。Caching可能大家会比较陌生，但是网也静态化现在连PHP产品的用户都非常清楚了。速度快、容 易被搜索到等等，好处不言而喻。开玩笑地说，现在网站的主页实现网页静态化只需要硬盘足够大。至于Caching就比较复杂些，也是大多数PHPer感到 头疼的地方。甚至于有些人会用C来实现。因为Caching中的数据有效期验证、查找、提取、更新等等都是比较难处理。当然，也有人会用数据库来处理 Caching问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2008/09/03/lamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>服务器网页缓存的深入分析</title>
		<link>http://www.bsdmap.com/2008/06/24/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e9%a1%b5%e7%bc%93%e5%ad%98%e7%9a%84%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90/</link>
		<comments>http://www.bsdmap.com/2008/06/24/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e9%a1%b5%e7%bc%93%e5%ad%98%e7%9a%84%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 06:24:43 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[性能相关]]></category>
		<category><![CDATA[技术备忘]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/~nnix/2008/06/24/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e9%a1%b5%e7%bc%93%e5%ad%98%e7%9a%84%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90/</guid>
		<description><![CDATA[转自：http://www.yuanma.org/data/2007/0909/article_2851.htm Expires、Cache-Control、Last-Modified、ETag是RFC 2616（HTTP/1.1）协议中和网页缓存相关的几个字段。前两个用来控制缓存的失效日期，后两个用来验证网页的有效性。要注意的是， HTTP/1.0有一个功能比较弱的缓存控制机制：Pragma，使用HTTP/1.0的缓存将忽略Expires和Cache-Control头。我们 这里以Apache2.0服务器为例，只讨论HTTP/1.1协议。 Expires Expires字段声明了一个网页或URL地址不再被浏览器缓存的时间，一旦超过了这个时间，浏览器都应该联系原始服务器。RFC告诉我们：“由于推断的失效时间也许会降低语义透明度，应该被谨慎使用，同时我们鼓励原始服务器尽可能提供确切的失效时间。” 对于一般的纯静态页面，如html、gif、jpg、css、js，默认安装的Apache服务器，不会在响应头添加这个字段。Firefox浏览器接受 到相应后，如果发现没有Expires字段，浏览器根据文件的类型和“Last-Modified”字段来推断出一个合适的失效时间，并存储在客户端。推 测出的时间一般是接受到响应时间后的三天左右。 Apache的expires_module模块可以在Http响应头部自动加上Expires字段。在Apache的httpd.conf文件中进行如下配置： #启用expires_module模块 LoadModule expires_module modules/mod_expires.so # 启用有效期控制 ExpiresActive On # GIF有效期为1个月 ExpiresByType image/gif A2592000 # HTML文档的有效期是最后修改时刻后的一星期 ExpiresByType text/html M604800 #以下的含义类似 ExpiresByType text/css “now plus 2 month” ExpiresByType text/js “now plus 2 day” ExpiresByType image/jpeg “access plus 2 month” ExpiresByType image/bmp “access plus 2 month” ExpiresByType [...]]]></description>
			<content:encoded><![CDATA[<div>转自：http://www.yuanma.org/data/2007/0909/article_2851.htm</div>
<p>Expires、Cache-Control、Last-Modified、ETag是RFC<br />
2616（HTTP/1.1）协议中和网页缓存相关的几个字段。前两个用来控制缓存的失效日期，后两个用来验证网页的有效性。要注意的是，<br />
HTTP/1.0有一个功能比较弱的缓存控制机制：Pragma，使用HTTP/1.0的缓存将忽略Expires和Cache-Control头。我们<br />
这里以Apache2.0服务器为例，只讨论HTTP/1.1协议。</p>
<div>Expires</div>
<div>Expires字段声明了一个网页或URL地址不再被浏览器缓存的时间，一旦超过了这个时间，浏览器都应该联系原始服务器。RFC告诉我们：“由于推断的失效时间也许会降低语义透明度，应该被谨慎使用，同时我们鼓励原始服务器尽可能提供确切的失效时间。”</div>
<div>对于一般的纯静态页面，如html、gif、jpg、css、js，默认安装的Apache服务器，不会在响应头添加这个字段。Firefox浏览器接受<br />
到相应后，如果发现没有Expires字段，浏览器根据文件的类型和“Last-Modified”字段来推断出一个合适的失效时间，并存储在客户端。推<br />
测出的时间一般是接受到响应时间后的三天左右。</div>
<div>Apache的expires_module模块可以在Http响应头部自动加上Expires字段。在Apache的httpd.conf文件中进行如下配置：</div>
<div>#启用expires_module模块<br />
LoadModule expires_module modules/mod_expires.so<br />
# 启用有效期控制<br />
ExpiresActive On<br />
# GIF有效期为1个月<br />
ExpiresByType image/gif A2592000<br />
# HTML文档的有效期是最后修改时刻后的一星期<br />
ExpiresByType text/html M604800<br />
#以下的含义类似<br />
ExpiresByType text/css “now plus 2 month”<br />
ExpiresByType text/js “now plus 2 day”<br />
ExpiresByType image/jpeg “access plus 2 month”<br />
ExpiresByType image/bmp “access plus 2 month”<br />
ExpiresByType image/x-icon “access plus 2 month”<br />
ExpiresByType image/png “access plus 2 month”</div>
<div>对于动态页面，如果在页面内部没有通过函数强制加上Expires，例如header(”Expires: ” . gmdate(”D,<br />
d M Y H:i:s”) . ” GMT”)，Apache服务器会把Wed, 11 Jan 1984 05:00:00<br />
GMT作为Expires字段内容，返回给浏览器。即认为动态页面总是失效的。而浏览器仍然会保存已经失效的动态页面。</div>
<div>可以发现Firefox浏览器总是缓存所有页面，不管失效、不失效还是没有声明失效时间。即使缓存中声明了一个网页的实效日期是<br />
1970-01- 01<br />
08:00:00，浏览器仍然会发送该文件在缓存中的Last-Modified和ETag字段。如果在服务器端验证通过，返回304状态，浏览器就还会<br />
使用此缓存。</div>
<div>Cache-Control</div>
<div>Cache-Control字段中可以声明多些元素，例如no-cache, must-revalidate,<br />
max-age=0等。这些元素用来指明页面被缓存最大时限，如何被缓存的，如何被转换到另一个不同的媒介，以及如何被存放在持久媒介中的。但是任何一个<br />
Cache-Control指令都不能保证隐私性或者数据的安全性。“private”和“no-store”指令可以为隐私性和安全性方面提供一些帮<br />
助，但是他们并不能用于替代身</div>
<div>份验证和加密。</div>
<div>Apache的mod_cern_meta模块允许文件级Http响应头部的控制，同时它也可以配置Cache-Control头（或任何其他头）。响应<br />
头文件是放在原始目录的子目录中，根据原始文件名所命名的一个文件。具体用法请参阅Apache的官方网站。其中Cache-Control :<br />
max-age表示失效日期。如果没有启动mod_cern_meta模块，Apache服务器会把Expires字段中的日期换算成以秒为单位的一个<br />
delta值，赋值给max-age。如果启动mod_cern_meta模块，并且配置了max-age值，Apache会将这个覆盖Expires字<br />
段。同时，max-age隐含了Canche-Control: public。这样浏览器接受到的Cache-Control :<br />
max-age和Expires值就是一致的。</div>
<div>如果失效日期Cache-Control : max-ag=0或者是负值，浏览器会在对应的缓存中把Expires设置为1970-01-01 08:00:00。</div>
<div>Last-Modified</div>
<div>Last-Modified和ETag是条件请求(Conditional<br />
Request)相关的两个字段。如果一个缓存收到了针对一个页面的请求，它发送一个验证请求询问服务器页面是否已经更改，在HTTP头里面带上”<br />
ETag”和”If Modify Since”头。服务器根据这些信息判断是否有更新信息，如果没有，就返回HTTP<br />
304（NotModify）；如果有更新，返回HTTP 200和更新的页面内容，并且携带新的”ETag”和”LastModified”。</div>
<div>使用这个机制，能够避免重复发送文件给浏览器，不过仍然会产生一个HTTP请求。</div>
<div>一般纯静态页面本身都会有Last-Modified信息，Apache服务器会读取页面文件中的Last-Modified信息，并添加到http响应头部。</div>
<div>对于动态页面，如果在页面内部没有通过函数强制加上Last-Modified，例如header(”Last-Modified:<br />
” . gmdate(”D, d M Y H:i:s”) . ”<br />
GMT”)，Apache服务器会把当前时间作为Last-Modified，返回给浏览器。</div>
<div>无论是纯静态页面还是动态页面，Firefox浏览器巧妙地按照接受到服务器响应的时间设置缓存页面的Last-Modified，而不是按照http响应头部中的Last-Modified字段。</div>
<div>ETag</div>
<div>既然有了Last-Modified，为什么还要用ETag字段呢？因为如果在一秒钟之内对一个文件进行两次更改，Last-Modified就会不正确。因此，HTTP/1.1利用Entity Tag头提供了更加严格的验证。</div>
<div>Apache服务器默认情况下，会对所有的静态、动态文件的响应头添加ETag字段。在Apache的httpd.conf文件中可以通过FileETag指令配置该选项。</div>
<div>FileETag指令配置了当文档是基于一个文件时用以创建 Etag（entity tag）响应头的文件的属性。在Apache<br />
1.3.22及以前，ETag的值是对文件的索引节（INode），大小（Size）和最后修改时间（MTime）进行Hash后得到的。如果一个目录的<br />
配置包含了‘FileETag INode MTime Size’而其一个子目录包含了‘FileETag<br />
-INode’那么这个子目录的设置（并会被其下任何没有进行覆盖的子目录继承）将等价于‘FileETag MTime Size’。</div>
<div>在多台负载平衡的服务器环境下，同一个文件会有不同的etag或者文件修改日期，浏览器每次都会重新下载。设置‘FileETag None’可以使响应头不再包含ETag字段。</div>
<div>三种典型web服务器Header设置内容过期方法</div>
<div>一、Internet 信息服务 (IIS)的内容过期设置</div>
<div>如果IIS 网站中有时间敏感信息，可以配置设置来保证过期信息不被代理服务器或 Web 浏览器缓存。可以配置网站内容，使之在任</div>
<div>何的时间自动过期。当启用内容过期时，Web 浏览器将比较当前日期和截止日期，以便决定是显示缓存页还是从服务器请求更新的页</div>
<div>。Microsoft ASP.NET 这样的服务器端技术可用于动态更改提供的内容。通常，时间敏感信息只限于单个文件、目录或网站；不过，您也可以为某台计算机上的所有网站设置内容过期。</div>
<div>必须是本地计算机上 Administrators 组的成员或者必须被委派了相应的权限，才能执行下列步骤。作为安全性的最佳操作，请使用不属于 Administrators 组的帐户登录计算机，然后使用运行方式命令以管理员身份运行 IIS管理器</div>
<div>在命令提示符下，键入 runas /user:administrative_accountname &#8220;mmc %systemroot%\system32\inetsrv\iis.msc&#8221;。</div>
<div>设置网站内容的过期时间<br />
1. 在 IIS 管理器中，展开本地计算机；右键单击要设置内容过期的网站、虚拟目录或文件，然后单击“属性”。<br />
2. 单击“HTTP 头”选项卡。<br />
3. 选中“启用内容过期”复选框。<br />
4. 单击“立即过期”、“此时间段后过期”或“过期时间”，然后在对应的框中输入所需的过期信息。<br />
5. 单击“确定”。</div>
<div>二、APACHE服务的内容过期设置</div>
<div>Apache配置摘录及解释<br />
i. 过期相关设置<br />
LoadModule headers_module modules/mod_headers.so<br />
#Load 修改header的模块。<br />
LoadModule expires_module modules/mod_expires.so<br />
#Load 设定过期header的模块。<br />
Header append Via: CCN-BJ-4-502<br />
#增加一个Via header，值配置成设备的hostname。<br />
KeepAliveTimeout 60<br />
#设置连接的保持时间为60秒。<br />
ExpiresActive On<br />
#启用过期header功能。<br />
ExpiresDefault A604800<br />
#缺省过期时间为“访问后的604800秒”</div>
<div>&lt;Directory /data/download&gt;<br />
Options FollowSymLinks<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
ExpiresByType text/html A300<br />
#text/html类型文件的过期设置为“访问后的300秒”<br />
ExpiresByType text/css A259200<br />
#text/css类型文件的过期设置为“访问后的259200秒”<br />
ExpiresByType application/x-javascript A300<br />
# application/x-javascript类型文件的过期设置为“访问后的300秒”<br />
ExpiresByType image/gif A2592000<br />
#image/gif类型文件的过期设置为“访问后的2592000秒”</div>
<div>ExpiresByType application/x-shockwave-flash A2592000</div>
<div># application/x-shockwave-flash类型文件的过期设置为“访问后的2592000秒”</div>
<div>&lt;/Directory&gt;<br />
上述配置文件中load的两个模块：mod_headers.so 和mod_expires.so 可以让Apache具有对header的一些定制功能。<br />
ExpiresByType： 表示按照文件类型－MIME-TYPE设定过期策略；<br />
A300： 表示在Access后300秒后过期；<br />
ExpiresByType text/css A2592000： 表示Mime type是text/css的文件，在Access后2592000秒过期。<br />
ExpiresDefault A604800： 表示除了单独制定的文件类型等过期策略外的其他内容，按照这个缺省的策略设定：访问后604800秒过期。<br />
上面的方法可以实现根据web发布的不同文件类型，针对不同的发布目录进行过期策略设置。在按照如上方法设置后，Apache会自动的产生两个相关的http header，举例如下：<br />
HTTP/1.1 200 OK<br />
Date: Tue, 27 Mar 2007 17:44:21 GMT<br />
Server: Apache/2.0.54 (Unix)<br />
Last-Modified: Thu, 25 Jan 2007 07:45:45 GMT<br />
ETag: “72df3a-93-99499c40”<br />
Accept-Ranges: bytes<br />
Content-Length: 147<br />
Cache-Control: max-age=2592000<br />
Expires: Thu, 26 Apr 2007 17:44:21 GMT<br />
Via: CCN-BJ-4-575<br />
Keep-Alive: timeout=60, max=100<br />
Connection: Keep-Alive<br />
Content-Type: image/gif</div>
<div>Length: 147 [image/gif]<br />
其中：Date ＋ Max-age = Expires.<br />
Max-age是个时间长度，对应web<br />
server上面设置的过期时间；Expires是根据max-age算出来的过期时间点，两者是一致的，不同cache在判断内容是否过期时会严格比较<br />
系统时间和上述过期时间，或者比较age（在cache中存住的时间长度）和max-age的值。</div>
<div>三、lighttpd</div>
<div>lighttpd默认是没有开启expire模块的，需要我们在使用是手工开启这个模块支持。把mod_expire前面的“#”号去掉。</div>
<div># vi /usr/local/lighttpd/etc/lighttpd.conf<br />
&#8220;mod_expire&#8221;,</div>
<div>设定过期时间</div>
<div>* 设定指定url的过期时间：</div>
<div>expire.url = (<br />
&#8220;/images/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/admin/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/area/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/calendar/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/common/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/front/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/inc/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/jeditor/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/js/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/script/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/theme/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/upload/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/view/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/help/&#8221; =&gt; &#8220;access 3 hours&#8221;,<br />
&#8220;/htm/&#8221; =&gt; &#8220;access 5 minutes&#8221;<br />
)</div>
<div>设置Etag</div>
<div>在配置文件中增加，etag.use-inode=&#8221;disable&#8221;（i节点不参与etag的运算），保证多台服务器生成的Etag值一致。</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2008/06/24/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e9%a1%b5%e7%bc%93%e5%ad%98%e7%9a%84%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx versus Apache</title>
		<link>http://www.bsdmap.com/2008/04/25/nginx-versus-apache/</link>
		<comments>http://www.bsdmap.com/2008/04/25/nginx-versus-apache/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 16:19:54 +0000</pubDate>
		<dc:creator>洪川</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.bsdmap.com/~nnix/2008/04/25/nginx-versus-apache/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td width="350"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="432" height="380" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="ssss" /><param name="src" value="http://vhead.blog.sina.com.cn/player/outer_player.swf?auto=0&amp;vid=10894989&amp;uid=1278987704type=" /><embed type="application/x-shockwave-flash" width="432" height="380" src="http://vhead.blog.sina.com.cn/player/outer_player.swf?auto=0&amp;vid=10894989&amp;uid=1278987704type=" name="ssss"></embed></object></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdmap.com/2008/04/25/nginx-versus-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

