<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[Apache安装apr和apr-util作用及安装方法,及安装prefork模式参数。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Sat, 17 Sep 2016 14:49:31 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ httpd-2.4.23]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite 
configure: 
checking for APR-util... no
configure: error: APR-util not found.&nbsp;&nbsp;Please read the documentation.&#92;
</textarea><br/><br/><textarea name="code" class="php" rows="15" cols="100">
今日编译apache时出错：
#./configure --prefix……检查编辑环境时出现：
checking for APR... no
configure: error: APR not found .&nbsp;&nbsp;Please read the documentation
解决办法：
1.下载所需软件包：
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz&nbsp;&nbsp;
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz&nbsp;&nbsp;
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip&nbsp;&nbsp; 
2.编译安装：
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs 
......
</textarea><br/>实践用最新的：<br/>wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz<br/>wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz<br/>wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.tar.gz<br/><br/>根据下面这个链接，编译好相关apache需要的包后，<br/><textarea name="code" class="php" rows="15" cols="100">
 ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite&nbsp;&nbsp;&#92;
 --with-apr=/usr/local/apr &#92;
--with-apr-util=/usr/local/apr-util/ &#92;
 --with-pcre=/usr/local/pcre
</textarea><br/>#apachectl –l<br/><br/>看到的prefork.c，说明使用的prefork工作模式。<br/><br/>可以在编译的时候使用#--with-mpm=prefork对应的工作模式名称来修改工作模式:<br/>./configure --help&#124;grep with-mpm<br/>&nbsp;&nbsp;--with-mpm=MPM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Choose the process model for Apache to use by<br/><textarea name="code" class="php" rows="15" cols="100">
 ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite&nbsp;&nbsp;&#92;
 --with-apr=/usr/local/apr &#92;
--with-apr-util=/usr/local/apr-util/ &#92;
 --with-pcre=/usr/local/pcre &#92;
--with-mpm=prefork
</textarea><br/>加上就好了：<br/>[root@iZ25dcp92ckZ bin]# ./apachectl -l<br/>Compiled in modules:<br/>&nbsp;&nbsp;core.c<br/>&nbsp;&nbsp;mod_so.c<br/>&nbsp;&nbsp;http_core.c<br/>&nbsp;&nbsp;event.c<br/>[root@iZ25dcp92ckZ bin]# ./apachectl -l<br/>Compiled in modules:<br/>&nbsp;&nbsp;core.c<br/>&nbsp;&nbsp;mod_so.c<br/>&nbsp;&nbsp;http_core.c<br/>&nbsp;&nbsp;prefork.c<br/><br/><br/><textarea name="code" class="php" rows="15" cols="100">
&lt;IfModule prefork.c&gt;
User&nbsp;&nbsp;www
Group www
StartServers 1
MinSpareServers 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MaxSpareServers 2
ServerLimit 2000
MaxClients 1000
MaxRequestsPerChild 10000
&lt;/IfModule&gt;
</textarea><br/>1root两www进程，搞定：<br/>/usr/local/apache2/bin/httpd -k restart<br/>/usr/local/apache2/bin/httpd -k restart<br/>/usr/local/apache2/bin/httpd -k restart<br/>静态： <br/>在使用./configure 编译的时候，如果不指定某个模块为动态，即没有使用：enable-mods-shared=module或者enable-module=shared 这个2个中的一个，那么所有的默认模块为静态。 那么何谓静态？&nbsp;&nbsp;其实就是编译的时候所有的模块自己编译进 httpd 这个文件中（我们启动可以使用这个执行文件,如： ./httpd &amp; ） ，启动的时候这些模块就已经加载进来了，也就是可以使用了， 通常为：&lt;ifmodule&gt; &lt;/ifmodule&gt; 来配置。所以大家看到的配置都是 &lt;ifmodule&nbsp;&nbsp;module.c&gt;&nbsp;&nbsp;，很显然，module.c这个东西已经存在 httpd这个文件中了。<br/><br/>动态： <br/>就是编译的时候，使用enable-module=shared 或者enable-modules-shared=module 来动态编译。&nbsp;&nbsp;那么什么是动态？&nbsp;&nbsp;静态是直接编译进httpd中， 那么动态显然就不编译进去了，也就是你启动的时候根本不会加载这个模块， 而是给你一个module.so 文件，你一定要使用 loadmodule 这个语法来加载，这个模块才有效。<br/>From:http://xtony.blog.51cto.com/3964396/836508/<br/><br/>Apache安装apr和apr-util作用:<br/> 安装Apache的时候，为什么要安装apr和apr-util呢<br/>要测APR给tomcat带来的好处最好的方法是在慢速网络上（模<br/>拟Internet），将Tomcat线程数开到300以上的水平，然后模<br/>拟一大堆并发请求。如果不配APR，基本上300个线程狠快就会<br/>用满，以后的请求就只好等待。但是配上APR之后，并发的线<br/>程数量明显下降，从原来的300可能会马上下降到只有几十，<br/>新的请求会毫无阻塞的进来。<br/>APR对于Tomcat最大的作用就是socket调度。<br/>你在局域网环境测，就算是400个并发，也是一瞬间就处理/传<br/><br/>输完毕，但是在真实的Internet环境下，页面处理时间只占<br/>0.1%都不到，绝大部分时间都用来页面传输。如果不用APR，<br/>一个线程同一时间只能处理一个用户，势必会造成阻塞。所以<br/>生产环境下用apr是非常必要的。<br/><br/>&nbsp;&nbsp;注：APR(Apache portable Run-time libraries，Apache可移植运行库)的目的如其名称一样，主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。<br/>&nbsp;&nbsp;&nbsp;&nbsp;在早期的Apache版本中，应用程序本身必须能够处理各种具体操作系统平台的细节，并针对不同的平台调用不同的处理函数。随着Apache的进一步开发，Apache组织决定将这些通用的函数独立出来并发展成为一个新的项目。这样，APR的开发就从Apache中独立出来，Apache仅仅是使用APR而已。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;一般情况下，APR开发包很容易理解为仅仅是一个开发包，不过事实上并不是。目前，完整的APR实际上包含了三个开发包：apr、apr-util以及apr-iconv，每一个开发包分别独立开发，并拥有自己的版本。<br/><br/>adapt from：http://wgkgood.blog.51cto.com/1192594/432272
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Apache安装apr和apr-util作用及安装方法,及安装prefork模式参数。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>