<?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月6号 -- <a href="http://ourapache.com/archives/74" title="Apache AllowOverride 指令">Apache AllowOverride 指令</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/270" title="Apache配置之URL重写">Apache配置之URL重写</a></li><li>2009年02月7号 -- <a href="http://ourapache.com/archives/85" title="apache之404错误页面">apache之404错误页面</a></li><li>2009年03月9号 -- <a href="http://ourapache.com/archives/222" title="Apache 2.0中prefork.c模块和worker.c模块的比较">Apache 2.0中prefork.c模块和worker.c模块的比较</a></li><li>2009年02月25号 -- <a href="http://ourapache.com/archives/170" title="Apache 两种虚拟主机方式的区别">Apache 两种虚拟主机方式的区别</a></li><li>2009年08月12号 -- <a href="http://ourapache.com/archives/268" title="Etag和Expires">Etag和Expires</a></li><li>2009年09月6号 -- <a href="http://ourapache.com/archives/303" title="基于资源的HTTP Cache的实现介绍">基于资源的HTTP Cache的实现介绍</a></li><li>2009年09月6号 -- <a href="http://ourapache.com/archives/306" title="网络流量尽在掌控">网络流量尽在掌控</a></li><li>2009年08月12号 -- <a href="http://ourapache.com/archives/265" title="关于apache的restart和stop, start的问题">关于apache的restart和stop, start的问题</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/15" title="Apache服务器限制并发连接和下载速度">Apache服务器限制并发连接和下载速度</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>

