<?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; 权限</title>
	<atom:link href="http://ourapache.com/archives/tag/%e6%9d%83%e9%99%90/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 core段的DocumentRoot与访问权限</title>
		<link>http://ourapache.com/archives/132</link>
		<comments>http://ourapache.com/archives/132#comments</comments>
		<pubDate>Thu, 12 Feb 2009 07:00:18 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache解错方案]]></category>
		<category><![CDATA[DocumentRoot]]></category>
		<category><![CDATA[权限]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=132</guid>
		<description><![CDATA[设置Apache的虚拟主机时的路径权限要仔细 ]]></description>
			<content:encoded><![CDATA[<p align="left">Tips:</p>
<p>设置Apache的虚拟主机时的路径权限要仔细</p>
<p align="left">虚拟主机段配置如下：</p>
<blockquote>
<p align="left">NameVirtualHost *:80<br />
&lt;VirtualHost *:80&gt; <br />
        ServerAdmin zhao@sst.cn <br />
        <a href="http://ourapache.com/archives/tag/documentroot" class="st_tag internal_tag" rel="tag" title="标签 DocumentRoot 下的日志">DocumentRoot</a> /somewhere/ww1 <br />
        ServerName ww1.sst.cn <br />
        ErrorLog logs/ww1.sst.cn-error_log <br />
        CustomLog logs/ww1.sst.cn-access_log common<br />
&lt;/VirtualHost&gt;<br />
&lt;VirtualHost *:80&gt; <br />
        ServerName ww2.sst.cn <br />
        DocumentRoot /somewhere/ww2<br />
&lt;/VirtualHost&gt;</p>
</blockquote>
<p>当apache core段的DocumentRoot 值设为/somewhere/ww1时，</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="284" valign="top">
<p align="left">访问ww1.sst.cn</p>
</td>
<td width="284" valign="top">
<p align="left">通过</p>
</td>
</tr>
<tr>
<td width="284" valign="top">
<p align="left">访问ww2.sst.cn</p>
</td>
<td width="284" valign="top">
<p align="left">Forbiddden</p>
</td>
</tr>
</tbody>
</table>
<p align="left">当apache core段的DocumentRoot 值设为/somewhere时，</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="284" valign="top">
<p align="left">访问ww1.sst.cn</p>
</td>
<td width="284" valign="top">
<p align="left">通过</p>
</td>
</tr>
<tr>
<td width="284" valign="top">
<p align="left">访问ww2.sst.cn</p>
</td>
<td width="284" valign="top">
<p align="left">通过</p>
</td>
</tr>
</tbody>
</table>
<p align="left">  分析下来禁止访问产生的原因，是httpd.conf中对相应Directory段没有增加定义，如上例，如果核心DocumentRoot（/somewhere/ww1）不是接下来定义的虚拟主机中的DocumentRoot（/somewhere/ww2）的父目录，则需要增加定义虚拟主机自有的DocumentRoot（/somewhere/ww2）其相应的Directory定义：</p>
<blockquote>
<p align="left">&lt;Directory /somewhere/ww2&gt;</p>
<p align="left">    Options FollowSymLinks</p>
<p align="left">    AllowOverride None</p>
<p align="left">&lt;/Directory&gt;</p>
</blockquote>
<p align="left">自己提醒自己千万要仔细，吃了两次亏，还是忘记。</p>
<h3  class="related_post_title">无相关文章，以下随机显示</h3><ul class="related_post"><li>2009年01月6号 -- <a href="http://ourapache.com/archives/29" title="Apache 中KeepAlive 配置的合理使用(优化) ">Apache 中KeepAlive 配置的合理使用(优化) </a></li><li>2009年02月19号 -- <a href="http://ourapache.com/archives/151" title="IE环境下的安全警告汇总收藏">IE环境下的安全警告汇总收藏</a></li><li>2009年09月6号 -- <a href="http://ourapache.com/archives/303" title="基于资源的HTTP Cache的实现介绍">基于资源的HTTP Cache的实现介绍</a></li><li>2010年04月13号 -- <a href="http://ourapache.com/archives/326" title="解决linux下安装ssl后，apache重启时需要密码">解决linux下安装ssl后，apache重启时需要密码</a></li><li>2009年12月12号 -- <a href="http://ourapache.com/archives/312" title="apache配置（如何禁止列出目录内容）">apache配置（如何禁止列出目录内容）</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/281" title="Linux下Apache并发连接数和带宽控制">Linux下Apache并发连接数和带宽控制</a></li><li>2009年02月10号 -- <a href="http://ourapache.com/archives/111" title="Apache 中内存管理的三种境界 ">Apache 中内存管理的三种境界 </a></li><li>2009年02月27号 -- <a href="http://ourapache.com/archives/193" title="header Content-Type类型">header Content-Type类型</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/273" title="Apache和IIS共享80端口的四个方法">Apache和IIS共享80端口的四个方法</a></li><li>2008年12月29号 -- <a href="http://ourapache.com/archives/17" title="使用apachebench进行post压力测试">使用apachebench进行post压力测试</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/debug" title="Apache解错方案" rel="tag">Apache解错方案</a>, <a href="http://ourapache.com/archives/tag/documentroot" title="DocumentRoot" rel="tag">DocumentRoot</a>, <a href="http://ourapache.com/archives/tag/%e6%9d%83%e9%99%90" title="权限" rel="tag">权限</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/132/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

