本地访问虚拟机unbuntu项目

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".
初步分析了一下错误原因是:安全异常,需要修改httpd-xampp.conf.这个文件在:/opt/lampp/etc/extra下。确定了需要改的地方。不过,网上上的解决方法都是这样的:
方法1:
"^/(?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
将Deny from al注释掉
#Deny from all
然后重新启动apache。我在这个文件中没找到这行,排除。

方法2:
 1、你需要按上边更改,注释掉那句话:
#Deny from all
2、像下面这样修改:(加入加粗的字)
"/opt/lampp/phpmyadmin">
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require allgranted
我发现配置文件里已经有上面的文字了,这时发现跟别人不一样的地方

#        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
正解方法是注掉本地访问这行,如下:      
#Require local
     最后,重启启动lampp,OK了,哈哈

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章