問題場景:
本機搭建一個apache服務器,正常訪問XAMPP目錄下的頁面。
手機接入同一wifi,以電腦ip方式訪問該目錄下的頁面;提示:Access Denied
Access to the requested directory is only available from the local network.
This setting can be configured in the file “httpd-xampp.conf”.
解決辦法:
1、按照提示找到httpd-xampp.conf文件,路徑在“/xampp/apache/conf/extra/httpd-xampp.conf”
2、文本編輯器打開文件,找到配置項:New XAMPP security concept
3、注釋原來的配置修改為允許訪問。
#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local
AllowOverride AuthConfig
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>