<?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>DBAlife &#187; apache</title>
	<atom:link href="http://www.dbalife.com/archives/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>网站系统架构实践</description>
	<lastBuildDate>Wed, 27 Jul 2011 09:57:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>用APXS编译Apache模块</title>
		<link>http://www.dbalife.com/archives/193.html</link>
		<comments>http://www.dbalife.com/archives/193.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 07:05:40 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[操作系统]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apxs]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/%e7%94%a8apxs%e7%bc%96%e8%af%91apache%e6%a8%a1%e5%9d%97/</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 Blogged with the Flock Browser Tags: apache, mod, apxs Related posts: PIX logging Architecture所需perl module的几点注意 20种让你的Apache更安全的设置 caucho-request的范围
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
<li><a href='http://www.dbalife.com/archives/15.html' rel='bookmark' title='20种让你的Apache更安全的设置'>20种让你的Apache更安全的设置</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='caucho-request的范围'>caucho-request的范围</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具，用于编译一个或多个源程序或目标代码文件为动态共享对象，使之可以用<code>LoadModule</code>指令在运行时加载到Apache服务器中。</p>
<p>1. 进入apache源代码的modules目录</p>
<p>2. 运行如下命令自动编译、安装和修改httpd.conf文件，激活mod_proxy模块：</p>
<blockquote><p>apache path/bin/apxs -c -i -a mod_proxy.c proxy_util.c</p>
</blockquote>
<p>选项说明：
</p>
<div style="margin-left: 40px;"> -c 执行编译操作<br />
-i 安装操作，安装一个或多个动态共享对象到服务器的modules目录<br />
-a 自动增加一个LoadModule行到httpd.conf文件，以激活此模块，若此行存在则启用之<br />
-A 与-a类似，但是它增加的LoadModule行前有井号前缀(#)<br />
-e 需要执行编辑操作，可与-a和-A选项配合使用，与-i操作类似，修改httpd.conf文件，但并不安装此模块</div>
<p>3. 如果还需要其他proxy模块如mod_proxy_http、mod_proxy_ftp，则单独</p>
<p><font size="2">apxs -c -i proxy_http.c<br />
apxs -c -i proxy_ftp.c</font></p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/apache" rel="tag">apache</a>, <a href="http://technorati.com/tag/mod" rel="tag">mod</a>, <a href="http://technorati.com/tag/apxs" rel="tag">apxs</a></p>
<p><!-- technorati tags end --></p>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
<li><a href='http://www.dbalife.com/archives/15.html' rel='bookmark' title='20种让你的Apache更安全的设置'>20种让你的Apache更安全的设置</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='caucho-request的范围'>caucho-request的范围</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/193.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache2.2与WordPress Permalink</title>
		<link>http://www.dbalife.com/archives/143.html</link>
		<comments>http://www.dbalife.com/archives/143.html#comments</comments>
		<pubDate>Mon, 14 Jul 2008 05:02:01 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[permalink]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=143</guid>
		<description><![CDATA[启用Wordpress permalink功能需要这么2个要素： Apache开启rewrite module wordpress目录中启用.htaccess .htaccess中有恰当的内容 标准的支持Wordpress Permalink的.htaccess是这样 # BEGIN WordPress &#60;IfModule mod_rewrite.c&#62; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] &#60;/IfModule&#62; # END WordPress 而对于虚拟主机下的wordpress，还需要用&#60;Directory&#62;标签指定 AllowOverride All 来启用.htaccess 一个例子 &#60;Virtualhost *.80&#62; …… &#60;Directory "/usr/local/www/helloworld"&#62; Options FollowSymLinks IncludesNOEXEC Indexes AllowOverride all Order Deny,Allow Allow from all &#60;/Directory&#62; …… &#60;/VirtualHost&#62; [...]
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/15.html' rel='bookmark' title='20种让你的Apache更安全的设置'>20种让你的Apache更安全的设置</a></li>
<li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/275.html' rel='bookmark' title='用插件解决wordpress引号问题'>用插件解决wordpress引号问题</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>启用Wordpress permalink功能需要这么2个要素：</p>
<ul>
<li>Apache开启rewrite module</li>
<li>wordpress目录中启用.htaccess</li>
<li>.htaccess中有恰当的内容</li>
</ul>
<p>标准的支持Wordpress Permalink的.htaccess是这样</p>
<blockquote><p># BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;<br />
# END WordPress</p></blockquote>
<p>而对于虚拟主机下的wordpress，还需要用&lt;Directory&gt;标签指定 AllowOverride All 来启用.htaccess<br />
一个例子</p>
<blockquote><p>&lt;Virtualhost *.80&gt;<br />
……<br />
&lt;Directory "/usr/local/www/helloworld"&gt;<br />
Options FollowSymLinks IncludesNOEXEC Indexes<br />
AllowOverride all<br />
Order Deny,Allow<br />
Allow from all<br />
&lt;/Directory&gt;<br />
……<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/15.html' rel='bookmark' title='20种让你的Apache更安全的设置'>20种让你的Apache更安全的设置</a></li>
<li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/275.html' rel='bookmark' title='用插件解决wordpress引号问题'>用插件解决wordpress引号问题</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/143.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache2与Resin2整合虚拟主机的配置</title>
		<link>http://www.dbalife.com/archives/126.html</link>
		<comments>http://www.dbalife.com/archives/126.html#comments</comments>
		<pubDate>Wed, 28 May 2008 03:31:30 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[resin]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=126</guid>
		<description><![CDATA[Apache＋Resin是许多网站采用的架构，Apache在前，Resin在后，可以实现负载均衡、解析各类应用及高扩展性等多种强大的功能。Apache的文档很多，但是涉及到Resin的资料比较少。最好的参考，依然是2者附带的官方文档，Resin中关联apache的部分讲的不够详细，许多细节依然需要自己多做测试，才可以找到合适的方法解决问题。 这里是一个Apache和Resin整合搭建虚拟主机的例子，版本号分别为Apache2.2.8和Resin2.1.17。 通过编译将Apache和Resin整合的资料很多，不再赘述。编译完成后Resin会在Apache的httpd.conf中添加2行 LoadModule caucho_module /opt/apache-2.2.8/modules/mod_caucho.so CauchoHost localhost 6802 如果要用Resin来解析jsp文件，需要添加 AddHandler caucho-request jsp SetHandler caucho-request Apache的配置 在httpd.conf中，首先加入 NameVirtualHost *:80 然后可以添加虚拟主机的配置段 &#60;VirtualHost *:80&#62; ServerAdmin wm@dbalife.com DocumentRoot /opt/resin-2.1.17/webapps ServerName vhost1.dbalife.com CauchoConfigFile /opt/resin-2.1.17/conf/vhost1.conf ErrorLog logs/ip-error_log TransferLog logs/ip-access_log &#60;/VirtualHost&#62; 与Apache单配虚拟主机差不多，多出一个字段CauchoConfigFile来指定这个虚拟主机的Resin配置文件。注意&#60;Virtualhost&#62;标签必须写在LoadModule caucho_module等Resin整合信息之后，以使Apache正确识别Virtualhost中的Resin相关字段。 Resin的配置 在CauchoConfigFile指定的配置文件vhost1.conf中，最简化只需要写入这样几句： &#60;caucho.com&#62; &#60;http-server&#62; &#60;srun host=localhost port=6802/&#62; &#60;host id='vhost1.dbalife.com'&#62; &#60;app-dir&#62;/opt/resin-2.1.17/webapps/vhost1&#60;/app-dir&#62; &#60;/host&#62; &#60;/http-server&#62; &#60;/caucho.com&#62; 即几个Resin配置文件的核心标签： &#60;caucho.con&#62;声明 &#60;http-server&#62;http服务段 &#60;srun&#62;进程通讯 &#60;host&#62;(虚拟)主机段 [...]
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/7.html' rel='bookmark' title='resin的优化'>resin的优化</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='caucho-request的范围'>caucho-request的范围</a></li>
<li><a href='http://www.dbalife.com/archives/327.html' rel='bookmark' title='vmware server 2.0 安装要点'>vmware server 2.0 安装要点</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Apache＋Resin是许多网站采用的架构，Apache在前，Resin在后，可以实现负载均衡、解析各类应用及高扩展性等多种强大的功能。Apache的文档很多，但是涉及到Resin的资料比较少。最好的参考，依然是2者附带的官方文档，Resin中关联apache的部分讲的不够详细，许多细节依然需要自己多做测试，才可以找到合适的方法解决问题。</p>
<p>这里是一个Apache和Resin整合搭建虚拟主机的例子，版本号分别为Apache2.2.8和Resin2.1.17。</p>
<p>通过编译将Apache和Resin整合的资料很多，不再赘述。编译完成后Resin会在Apache的httpd.conf中添加2行</p>
<blockquote><p>LoadModule caucho_module /opt/apache-2.2.8/modules/mod_caucho.so<br />
CauchoHost localhost 6802</p></blockquote>
<p>如果要用Resin来解析jsp文件，需要添加</p>
<blockquote><p>AddHandler caucho-request jsp<br />
SetHandler caucho-request</p></blockquote>
<h3>Apache的配置</h3>
<p>在httpd.conf中，首先加入</p>
<blockquote><p>NameVirtualHost *:80</p></blockquote>
<p>然后可以添加虚拟主机的配置段</p>
<blockquote><p>&lt;VirtualHost *:80&gt;<br />
ServerAdmin wm@dbalife.com<br />
DocumentRoot /opt/resin-2.1.17/webapps<br />
ServerName vhost1.dbalife.com<br />
CauchoConfigFile /opt/resin-2.1.17/conf/vhost1.conf<br />
ErrorLog logs/ip-error_log<br />
TransferLog logs/ip-access_log<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>与Apache单配虚拟主机差不多，多出一个字段CauchoConfigFile来指定这个虚拟主机的Resin配置文件。注意&lt;Virtualhost&gt;标签必须写在LoadModule caucho_module等Resin整合信息之后，以使Apache正确识别Virtualhost中的Resin相关字段。</p>
<h3>Resin的配置</h3>
<p>在CauchoConfigFile指定的配置文件vhost1.conf中，最简化只需要写入这样几句：</p>
<blockquote><p>&lt;caucho.com&gt;<br />
&lt;http-server&gt;<br />
&lt;srun host=localhost port=6802/&gt;<br />
&lt;host id='vhost1.dbalife.com'&gt;<br />
&lt;app-dir&gt;/opt/resin-2.1.17/webapps/vhost1&lt;/app-dir&gt;<br />
&lt;/host&gt;<br />
&lt;/http-server&gt;<br />
&lt;/caucho.com&gt;</p></blockquote>
<p>即几个Resin配置文件的核心标签：</p>
<ul>
<li>&lt;caucho.con&gt;声明</li>
<li>&lt;http-server&gt;http服务段</li>
<li>&lt;srun&gt;进程通讯</li>
<li>&lt;host&gt;(虚拟)主机段</li>
<li>&lt;app-dir&gt;应用发布路径</li>
</ul>
<p>如果配置多个虚拟主机，srun中的port需要指定<span style="color: #ff0000;">不同的端口号</span>，否则Resin启动会发生冲突。</p>
<p>至此简单的虚拟主机已经设定完毕.</p>
<p>启动虚拟主机：</p>
<blockquote><p><em>/opt/resin-2.1.17/bin/httpd.sh  -conf /opt/resin-2.1.17/conf/vhost1.conf -pid /opt/resin-2.1.17/conf/vhost1.pid start</em></p></blockquote>
<p>关闭虚拟主机:</p>
<blockquote><p><em>/opt/resin-2.1.17/bin/httpd.sh  -conf /opt/resin-2.1.17/conf/vhost1.conf -pid /opt/resin-2.1.17/conf/vhost1.pid stop</em></p></blockquote>
<p>对Resin应用的个性化需求，上面简单的配置文件不能满足需求。我们可以用&lt;resin:include&gt;标签来扩展配置文件。这里是一个完整的例子：</p>
<blockquote><p>&lt;caucho.com&gt;<br />
&lt;resin:include href='common_caucho.conf'/&gt;<br />
&lt;http-server&gt;<br />
&lt;srun host=localhost port=6802/&gt;<br />
&lt;resin:include href='common_httpserver.conf'/&gt;<br />
&lt;host id='vhost1.dbalife.com'&gt;<br />
&lt;app-dir&gt;/opt/resin-2.1.17/webapps/vhost1&lt;/app-dir&gt;<br />
&lt;resin:include href='common_host.conf'/&gt;<br />
&lt;/host&gt;<br />
&lt;/http-server&gt;<br />
&lt;/caucho.com&gt;</p></blockquote>
<p>在这个文件中，通过引入common_caucho.conf、common_httpserver.conf和common_host.conf，对&lt;caucho&gt;&lt;http-server&gt;&lt;host&gt;3个标签的内容进行丰富，最终形成一个完整的Resin配置文件，多个虚拟主机可以通过这种方式共享相同配置参数。</p>
<p>－EOF－</p>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/7.html' rel='bookmark' title='resin的优化'>resin的优化</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='caucho-request的范围'>caucho-request的范围</a></li>
<li><a href='http://www.dbalife.com/archives/327.html' rel='bookmark' title='vmware server 2.0 安装要点'>vmware server 2.0 安装要点</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/126.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

