我需要在我的httpd.conf中包含一个不在我的DocumentRoot
目录中的文件夹。 我知道有很多这方面的信息,但不是专门针对Windows上运行的Apache 2.4 。 我尝试了很多东西,但是一切都很成功,我总是得到一个被禁止的错误,这让我很生气。
这是我由WAMP所做的默认configuration:
<Directory /> AllowOverride none Require all denied </Directory> DocumentRoot "${INSTALL_DIR}/www" <Directory "${INSTALL_DIR}/www/"> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all Require local </Directory>
没关系,但我需要在E:\磁盘上包含一个文件夹项目。 我已经尝试了所有这些,显然每次尝试后重新启动Apache服务器:
尝试#1
<Directory "e:/Development/[Git]/projectName/public/"> Require all granted </Directory>
尝试#2
<Directory "e:/Development/[Git]/projectName/public/"> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all Require local </Directory>
尝试#3
Alias /projectName "e:/Development/[Git]/projectName/public/" # The <Directory> on attempts #1 and #2
只是为了澄清:
我已经尝试了很多使用/
或\
的组合。 也使用"
或者没有,我甚至试图逃脱[]
像这样\[Git\]
。
我已经为该目录configuration了一个VirtualHost
。 我知道这是因为如果我删除<Directory />
上的安全性,那么工作正常,但正如我已经读到这是缺乏安全性,我不想有:
# Disabling the security as below is not an option <Directory /> AllowOverride none Require all granted </Directory>
任何人都可以帮我吗? 提前致谢