通过宿主机机访问linux虚拟机的xamp服务出现如下的错误提示:
Access forbidden!
New XAMPP security concept:
Access to the requested object is only available from the local network.
This setting can be configured in the file "httpd-xampp.conf".
If you think this is a server error, please contact the webmaster.
Error 403
192.168.43.128
Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.4.31 mod_perl/2.0.8-dev Perl/v5.16.3
,提示无法访问本地网络, 权限受限制了。
假定xmapp服务安装在/opt/lampp/下面,我运行的版本是 XAMPP for Linux 1.8.2-6,untuntu14.10
找到/opt/lampp/etc/extra/httpd-xampp.conf 这个文件,打开编辑这一栏:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
# Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>,
注释掉Require local,然后执行重新运行的命令“sudo /opt/lampp/lampp restart”。
有的给出这种方案
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>,
注释掉"将Deny from all这一行注释掉", 我安装的文档没有这个。