<?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; DocumentRoot</title>
	<atom:link href="http://ourapache.com/archives/tag/documentroot/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年02月25号 -- <a href="http://ourapache.com/archives/163" title="apache 的mime.types文件">apache 的mime.types文件</a></li><li>2010年04月13号 -- <a href="http://ourapache.com/archives/322" title="apache 的AcceptMutex 的理解">apache 的AcceptMutex 的理解</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/270" title="Apache配置之URL重写">Apache配置之URL重写</a></li><li>2009年02月12号 -- <a href="http://ourapache.com/archives/136" title="让apache支持自定义404页面错误">让apache支持自定义404页面错误</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/3" title="apache的配置优化">apache的配置优化</a></li><li>2009年02月7号 -- <a href="http://ourapache.com/archives/85" title="apache之404错误页面">apache之404错误页面</a></li><li>2009年01月6号 -- <a href="http://ourapache.com/archives/29" title="Apache 中KeepAlive 配置的合理使用(优化) ">Apache 中KeepAlive 配置的合理使用(优化) </a></li><li>2009年05月8号 -- <a href="http://ourapache.com/archives/245" title="用apache实现禁止IP段或者主机对某个目录的访问">用apache实现禁止IP段或者主机对某个目录的访问</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/9" title="apache禁止使用IP访问的实现方法">apache禁止使用IP访问的实现方法</a></li><li>2009年02月26号 -- <a href="http://ourapache.com/archives/184" title="Apache日志文件（配置和管理）">Apache日志文件（配置和管理）</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>

