最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

apache documentroot指向htcdoc之外提示403錯誤的解決方法

 更新時間:2010年04月20日 23:13:54   作者:  
在windows和RH都碰到過,只要把主目錄指到其他地方后就出現(xiàn)權限不夠的403提示,郁悶了好久。
后來發(fā)現(xiàn),原來又是Apache沒配置 好,是apache的mod_authz_host模塊在起控制作用。
1.如果不啟用vhosts
只需修改 httpd.conf
默認Directory節(jié)如下,注意紅色部分,表示目錄/usr/local/apache/htdocs允許所有 主機訪問
復制代碼 代碼如下:

<Directory "/usr/local/apache/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>

由于主目錄被指到別的地方了,所以將藍色部分/usr/local/apache/htdocs換成你新的主目錄就OK了。
2.啟用vhosts
啟 用vhosts的話,你就可以不作上面的修改了,因為VirtualHost可以單獨配置這個節(jié)的屬性,所以我們在VirtualHost這個節(jié)里配置的 話就更方便了,下面的配置中,我把我的網站放在/var/vhosts/www.test.cn下。
復制代碼 代碼如下:

/usr/local/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
<Directory "/var/vhosts/www.test.cn" >
#Deny from all
Allow from all
</Directory>
DocumentRoot "/var/vhosts/www.test.cn"
ServerName www.test.cn
</VirtualHost>

如果把Deny from all的注釋去掉,那么服務器就會拒絕所有訪問(和我們剛開始把主目錄移動到htdocs外而沒做任何配置修改時一樣,哈哈)
補充一點:
如果你是寫個index.php放在目錄下測試,可要注意了,記得加上默認主頁index.php
DirectoryIndex index.html index.php

相關文章

最新評論

鱼台县| 富宁县| 瑞安市| 石楼县| 绥中县| 诸城市| 陕西省| 凌源市| 新乐市| 林芝县| 札达县| 玉屏| 庄河市| 中阳县| 观塘区| 丰县| 新昌县| 大悟县| 凌云县| 资中县| 辽阳县| 辽阳市| 兰坪| 视频| 霸州市| 辽源市| 和田县| 香港| 丰原市| 中西区| 天峨县| 资源县| 咸阳市| 民县| 田东县| 嫩江县| 额尔古纳市| 门头沟区| 江安县| 五河县| 青浦区|