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

<channel>
	<title>OurApache &#187; inetd</title>
	<atom:link href="http://ourapache.com/archives/tag/inetd/feed" rel="self" type="application/rss+xml" />
	<link>http://ourapache.com</link>
	<description>我们致力于一个Apache知识的分享网站</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Apache两种运行方式比较:Standalone和inetd</title>
		<link>http://ourapache.com/archives/292</link>
		<comments>http://ourapache.com/archives/292#comments</comments>
		<pubDate>Sun, 16 Aug 2009 14:33:57 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache基础知识]]></category>
		<category><![CDATA[inetd]]></category>
		<category><![CDATA[Standalone]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=292</guid>
		<description><![CDATA[standalone模式表示Apache进程以一个单独的守护进程方式在后台监听是否有客户端的请求，如果有则生成一个子进程来为其服务。在 standalone模式下，apache进程一次性启动，运行期间一直驻留在内存中，尽管损耗了一定的系统资源，但接入信号反应快；而且子httpd进 程在http请求完毕后并没有直接断掉，这样就可以重新用来接受新的http请求，请参考apache的keepalive指令（请看这里）。由于不存在对每个请求都启动新的apache根进程，所以它的效率更高。
inetd模式表示Apache服务不是以一个单独的守候进程的形式支持。而是由Inetd这个超级守候进程进行代劳，当它监听一个客户端的http请求 的时候，再启动一个httpd进程为其服务。一个由inted运行的服务器进程在它结束对请求服务的同时立刻退出，虽然不占用了系统资源，但是也由此不适 合应用在同时连接数量较多的系统。因为如果请求完毕后就结束httpd进程，会使服务器负担加重。]]></description>
			<content:encoded><![CDATA[<p>那天和大家分享了<a href="http://www.ourapache.com/archives/288" target="_blank">Apache常见两种工作模式</a>的对比。今天和大家分享下Apache的两种运行方式(Standalone和inetd)的比较。</p>
<p><strong>standalone模式</strong>表示Apache进程以一个单独的守护进程方式在后台监听是否有客户端的请求，如果有则生成一个子进程来为其服务。在 standalone模式下，apache进程一次性启动，运行期间一直驻留在内存中，尽管损耗了一定的系统资源，但接入信号反应快；而且子httpd进 程在http请求完毕后并没有直接断掉，这样就可以重新用来接受新的http请求，请参考apache的keepalive指令（<a href="http://www.ourapache.com/archives/tag/keepalive" target="_blank">请看这里</a>）。由于不存在对每个请求都启动新的apache根进程，所以它的效率更高。</p>
<p><strong>inetd模式</strong>表示Apache服务不是以一个单独的守候进程的形式支持。而是由Inetd这个超级守候进程进行代劳，当它监听一个客户端的http请求 的时候，再启动一个httpd进程为其服务。一个由inted运行的服务器进程在它结束对请求服务的同时立刻退出，虽然不占用了系统资源，但是也由此不适 合应用在同时连接数量较多的系统。因为如果请求完毕后就结束httpd进程，会使服务器负担加重。</p>
<p>具体使用如下：</p>
<p><strong>standalone模式</strong></p>
<p>此种模式下，Apache服务器监听特定端口的连接请求。当用户发起特定端口地址的连接请求时，主服务器进程启动子httpd进程来响应该请求。</p>
<p>这样还需要告诉主服务器进程侦听的特定端口地址，使用命令：</p>
<blockquote><p>Port [number] （缺省值为80）</p></blockquote>
<p><strong>inetd模式</strong></p>
<p>inetd是监听所有小于1024的端口连接请求的Internet守护进程(一个服务器进程)。与standalone模式不同，当客户系统发出到Apache服务器的连接请求时，inetd启动一个httpd进程，由此进程服务此请求，完成服务后即退出。</p>
<p>如果选择通过inetd服务器来运行Apache，需要编辑/etc/<a href="http://ourapache.com/archives/tag/inetd" class="st_tag internal_tag" rel="tag" title="标签 inetd 下的日志">inetd</a>.conf文件为Apache添加一条新的记录：</p>
<blockquote><p>httpd stream tcp nowait httpd /etc/httpd/bin/httpd –f /etc/httpd/conf/httpd.conf</p></blockquote>
<p>修改了/etc/inetd.conf文件后，就需要修改/etc/services中添加一行</p>
<blockquote><p>httpd 80/tcp httpd</p></blockquote>
<p>做完以上修改后，需要重新启动inetd进程。首先，使用以下命令取得inetd的进程ID：</p>
<blockquote><p>ps auxw | grep inetd</p></blockquote>
<p>然后执行命令：kill -HUP pid</p>
<h3  class="related_post_title">无相关文章，以下随机显示</h3><ul class="related_post"><li>2009年02月10号 -- <a href="http://ourapache.com/archives/123" title="Apache高级配置中文详解">Apache高级配置中文详解</a></li><li>2009年06月14号 -- <a href="http://ourapache.com/archives/253" title="Apache自动添加地址末尾的斜线">Apache自动添加地址末尾的斜线</a></li><li>2009年02月27号 -- <a href="http://ourapache.com/archives/187" title="header中的Cache-control参数说明">header中的Cache-control参数说明</a></li><li>2009年12月12号 -- <a href="http://ourapache.com/archives/314" title="使用Apache做负载均衡">使用Apache做负载均衡</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/284" title="Apache负载均衡设置方法: mod_proxy">Apache负载均衡设置方法: mod_proxy</a></li><li>2009年08月16号 -- <a href="http://ourapache.com/archives/288" title="Apache两种常用工作模式比较:prefork和worker">Apache两种常用工作模式比较:prefork和worker</a></li><li>2009年07月14号 -- <a href="http://ourapache.com/archives/263" title="初识HTTP中的Referer">初识HTTP中的Referer</a></li><li>2010年03月9号 -- <a href="http://ourapache.com/archives/318" title="Apache2中俩种设置PHP的异同">Apache2中俩种设置PHP的异同</a></li><li>2009年02月7号 -- <a href="http://ourapache.com/archives/85" title="apache之404错误页面">apache之404错误页面</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/9" title="apache禁止使用IP访问的实现方法">apache禁止使用IP访问的实现方法</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/basic" title="Apache基础知识" rel="tag">Apache基础知识</a>, <a href="http://ourapache.com/archives/tag/inetd" title="inetd" rel="tag">inetd</a>, <a href="http://ourapache.com/archives/tag/standalone" title="Standalone" rel="tag">Standalone</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/292/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

