<?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.54chen.com/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.54chen.com</link>
	<description>PHP、JAVA、缓存、架构、经验、分享</description>
	<lastBuildDate>Fri, 10 Feb 2012 12:21:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>如何建立自己的Apache扩展</title>
		<link>http://www.54chen.com/_linux_/%e5%a6%82%e4%bd%95%e5%bb%ba%e7%ab%8b%e8%87%aa%e5%b7%b1%e7%9a%84apache%e6%89%a9%e5%b1%95.html</link>
		<comments>http://www.54chen.com/_linux_/%e5%a6%82%e4%bd%95%e5%bb%ba%e7%ab%8b%e8%87%aa%e5%b7%b1%e7%9a%84apache%e6%89%a9%e5%b1%95.html#comments</comments>
		<pubDate>Mon, 19 Jan 2009 07:36:15 +0000</pubDate>
		<dc:creator>cc0cc</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.54chen.com/_linux_/%e5%a6%82%e4%bd%95%e5%bb%ba%e7%ab%8b%e8%87%aa%e5%b7%b1%e7%9a%84apache%e6%89%a9%e5%b1%95.html</guid>
		<description><![CDATA[<a href="http://www.54chen.com"><img border="0" src="http://www.54chen.com/wp-content/themes/54chen2011/images/54chen-logo.gif"></a><br>以下内容由<a href="http://www.54chen.com">[五四陈科学院]</a>提供<br>  假设有一个扩展Apache功能的模块mod_foo.c ，使用下列命令，可以将C源程序编译为共享模块，以在运行时加载到Apache服务器中： $ apxs -c mod_foo.c /path/to/libtool --mode=compile gcc ... -c mod_foo.c /path/to/libtool --mode=link gcc ... -o mod_foo.la mod_foo.slo $ _ 然后，必须修改Apache的配置，以确保有一个LoadModule 指令来加载此共享对象。为了简化这一步骤，apxs 可以自动进行该操作，以安装此共享对象到"modules"目录，并更新httpd.conf 文件，命令如下： $ apxs -i -a mod_foo.la /path/to/instdso.sh mod_foo.la /path/to/apache/modules /path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules ... chmod 755 /path/to/apache/modules/mod_foo.so &#8230;<br><br>想快点找到作者也可以到Twitter上留言: <a href="https://www.twitter.com/54chen" target="_blank">@54chen</a><br>或者你懒得带梯子上墙，请到新浪微博：<a href="http://t.sina.com.cn/54chen" target="_blank">@54chen</a>]]></description>
			<content:encoded><![CDATA[<a href="http://www.54chen.com"><img border="0" src="http://www.54chen.com/wp-content/themes/54chen2011/images/54chen-logo.gif"></a><br>以下内容由<a href="http://www.54chen.com">[五四陈科学院]</a>提供<br><p> </p>
<p>假设有一个扩展Apache功能的模块<code>mod_foo.c</code> ，使用下列命令，可以将C源程序编译为共享模块，以在运行时加载到Apache服务器中：</p>
<div class="example">
<p><code> $ apxs -c mod_foo.c<br />
/path/to/libtool --mode=compile gcc ... -c mod_foo.c<br />
/path/to/libtool --mode=link gcc ... -o mod_foo.la mod_foo.slo<br />
$ _ </code></div>
<p>然后，必须修改Apache的配置，以确保有一个<code class="directive">LoadModule </code>指令来加载此共享对象。为了简化这一步骤，<code>apxs</code> 可以自动进行该操作，以安装此共享对象到"modules"目录，并更新<code><a href="http://www.54chen.com/c/148">httpd</a>.conf</code> 文件，命令如下：</p>
<div class="example">
<p><code> $ apxs -i -a mod_foo.la<br />
/path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
/path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules       ...       chmod 755 /path/to/apache/modules/mod_foo.so<br />
[activating module 'foo' in /path/to/apache/conf/httpd.conf]<br />
$ _ </code></div>
<p>如果配置文件中尚不存在，会增加下列的行：</p>
<div class="example">
<p><code> LoadModule foo_module modules/mod_foo.so </code></div>
<p>如果你希望默认禁用此模块，可以使用 <code>-A</code> 选项，即：</p>
<div class="example">
<p><code> $ apxs -i -A mod_foo.c </code></div>
<p>要快速测试apxs机制，可以建立一个Apache模块样板及其对应的Makefile ：</p>
<div class="example">
<p><code> $ apxs -g -n foo<br />
Creating [DIR]  foo<br />
Creating [FILE] foo/Makefile<br />
Creating [FILE] foo/modules.mk<br />
Creating [FILE] foo/mod_foo.c<br />
Creating [FILE] foo/.deps<br />
$ _ </code></div>
<p>然后，立即可以编译此样板模块为共享对象并加载到<a href="http://www.54chen.com/c/26">Apache</a>服务器中：</p>
<div class="example">
<p><code> $ cd foo<br />
$ make all reload<br />
apxs -c mod_foo.c<br />
/path/to/libtool --mode=compile gcc ... -c mod_foo.c<br />
/path/to/libtool --mode=link gcc ... -o mod_foo.la mod_foo.slo<br />
apxs -i -a -n "foo" mod_foo.la<br />
/path/to/instdso.sh mod_foo.la /path/to/apache/modules<br />
/path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules       ...       chmod 755 /path/to/apache/modules/mod_foo.so<br />
[activating module 'foo' in /path/to/apache/conf/httpd.conf]<br />
apachectl restart<br />
/path/to/apache/sbin/apachectl restart: httpd not running, trying to start<br />
[Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module<br />
/path/to/apache/sbin/apachectl restart: httpd started<br />
$ _</code></div>
<br><br>想快点找到作者也可以到Twitter上留言: <a href="https://www.twitter.com/54chen" target="_blank">@54chen</a><br>或者你懒得带梯子上墙，请到新浪微博：<a href="http://t.sina.com.cn/54chen" target="_blank">@54chen</a>]]></content:encoded>
			<wfw:commentRss>http://www.54chen.com/_linux_/%e5%a6%82%e4%bd%95%e5%bb%ba%e7%ab%8b%e8%87%aa%e5%b7%b1%e7%9a%84apache%e6%89%a9%e5%b1%95.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>APACHE常用设置</title>
		<link>http://www.54chen.com/php-tech/apache-common-set.html</link>
		<comments>http://www.54chen.com/php-tech/apache-common-set.html#comments</comments>
		<pubDate>Mon, 23 Oct 2006 14:49:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[http.conf]]></category>

		<guid isPermaLink="false">http://www.54chen.com/php-tech/apache-common-set.html</guid>
		<description><![CDATA[<a href="http://www.54chen.com"><img border="0" src="http://www.54chen.com/wp-content/themes/54chen2011/images/54chen-logo.gif"></a><br>以下内容由<a href="http://www.54chen.com">[五四陈科学院]</a>提供<br>KeepAliveTimeout 5 是允许用户保持连接5秒内有效，如果用户在5秒内点击其他页面不需要重新建立联结，这个值设置短不利于降低效率，如果设置长可能导致的同时联结数会跟高，一般建议按照缺省的15 MaxKeepAliveRequests 这个缺省是100 你这个设置太高了，这个使用户连续访问了多少个页面后重新建立联结，你这个值3000，好像太高了点 MinSpareServers 5 MaxSpareServers 10 StartServers 5 如果服务器经常有突发大量请求的话，建议值都稍微太高点 MaxClients 150 这个是服务器最大联结数，如果超过150联结的话系统就有等待情况，如果繁忙的话150是不够的，你可以用命令 ps -ef&#124;grep httpd&#124;wc -l 看看有多少联结，一直接近150的话，建议增大一些 MaxRequestsPerChild 0 这个建立设置10000，apache避免程序有异常，定义一个子进程完成多少个请求以后退出，如果是0就是永远不退出。如果对自己程序比较难把我的话建议设置一个稍大的值而不是0<br><br>想快点找到作者也可以到Twitter上留言: <a href="https://www.twitter.com/54chen" target="_blank">@54chen</a><br>或者你懒得带梯子上墙，请到新浪微博：<a href="http://t.sina.com.cn/54chen" target="_blank">@54chen</a>]]></description>
			<content:encoded><![CDATA[<a href="http://www.54chen.com"><img border="0" src="http://www.54chen.com/wp-content/themes/54chen2011/images/54chen-logo.gif"></a><br>以下内容由<a href="http://www.54chen.com">[五四陈科学院]</a>提供<br><p>KeepAliveTimeout 5</p>
<p>是允许用户保持连接5秒内有效，如果用户在5秒内点击其他页面不需要重新建立联结，这个值设置短不利于降低效率，如果设置长可能导致的同时联结数会跟高，一般建议按照缺省的15</p>
<p>MaxKeepAliveRequests 这个缺省是100 你这个设置太高了，这个使用户连续访问了多少个页面后重新建立联结，你这个值3000，好像太高了点</p>
<p>MinSpareServers 5<br />
MaxSpareServers 10<br />
StartServers 5<br />
如果服务器经常有突发大量请求的话，建议值都稍微太高点<br />
MaxClients 150<br />
这个是服务器最大联结数，如果超过150联结的话系统就有等待情况，如果繁忙的话150是不够的，你可以用命令 ps -ef|grep httpd|wc -l 看看有多少联结，一直接近150的话，建议增大一些</p>
<p>MaxRequestsPerChild 0<br />
这个建立设置10000，apache避免程序有异常，定义一个子进程完成多少个请求以后退出，如果是0就是永远不退出。如果对自己程序比较难把我的话建议设置一个稍大的值而不是0</p>
<br><br>想快点找到作者也可以到Twitter上留言: <a href="https://www.twitter.com/54chen" target="_blank">@54chen</a><br>或者你懒得带梯子上墙，请到新浪微博：<a href="http://t.sina.com.cn/54chen" target="_blank">@54chen</a>]]></content:encoded>
			<wfw:commentRss>http://www.54chen.com/php-tech/apache-common-set.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

