我正在尝试将 Apache 根目录从
/Users/"my user"/applications/XAMPP/htdocs
到
/Users/"my user"/dropbox/sites
目录,这样我的文件就会自动备份到 Dropbox。但是,在 XAMPP 中重新启动服务器后,我得到了“拒绝访问!没有索引……”错误。
- Macbook Pro,OSX Mavericks
- XAMPP最新版本
这是我的 https.conf,有关文档根目录的部分:
# DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
DocumentRoot "/Users/edchigliak/dropbox/sites"
<Directory "/Users/edchigliak/dropbox/sites">
#
# 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/trunk/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
# XAMPP
Options Indexes FollowSymLinks ExecCGI Includes
#
# 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
# since XAMPP 1.4:
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
如您所见,我只是注释了第一行 #DocumentRoot,将其复制到下一行并更改了路径。在那下面,我还复制了想要授予新根目录权限的正确路径。在此过程中出现了一些问题 :))
有任何想法吗?
答案1
默认情况下,运行 Apache 的用户将无法访问特定用户的主目录,您需要授予该访问权限才能正常工作。