[英]Windows server 2012 : Access forbidden for xampp project
使用Windows Server 2012安裝了XAMPP(Apache / 2.4.33(Win32)OpenSSL / 1.0.2o PHP / 5.6.36),幾乎檢查了stackoverflow答案,但得到了相同的錯誤。
除xampp儀表板外,xampp不能訪問htdocs中的任何項目。
錯誤:
httpd-vhost.conf:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mysite"
ServerName local.yourdomain.com
<Directory "C:/xampp/htdocs/mysite">
Require all granted
</Directory>
</VirtualHost>
主持人:
127.0.0.1 localhost
127.0.0.1 local.yourdomain.com
httpd.conf:
DocumentRoot "C:/xampp/htdocs/mysite"
<Directory "C:/xampp/htdocs/mysite">
#
# 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.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
我發現這403個錯誤(幾乎)始終是Apache配置錯誤。 不幸的是,日志中沒有很多診斷信息。
在您的httpd-vhosts.conf文件中嘗試以下操作:
<VirtualHost *:80>
ServerName example.local
DocumentRoot "C:\Users\shipl\htdocs\example"
<Directory "C:\Users\shipl\htdocs\example">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
這樣,您的主機將具有:
127.0.0.1 localhost
127.0.0.1 example.local
注意,“ example.local”和“ \\ htdocs \\ example”在所有引用中必須一致。
希望這可以幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.