2012-08-17 54 views
19

我刚安装了xampp 1.8.0 for linux,当我打开phpmyadmin时出现了这个错误 访问禁止!只能从本地网络访问请求的对象phpmyadmin

 
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". 

我试过this后,但没有运气。请帮忙。我从我自己的PC上打开它,而不是从任何其他网络打开它。

+0

[尝试从网络访问XAMPP时出现错误]的可能重复(http://stackoverflow.com/questions/6083323/error-when-trying-to-access-xampp-from-a-network) – 2013-11-09 19:47:10

回答

40

打开您的http.conf文件

vim /opt/lampp/etc/extra/httpd-xampp.conf 

评论 “所有拒绝” 在下面的部分,

# 
# New XAMPP security concept 
# 
<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> 

编辑:
尝试添加“,从所有允许“之前”ErrorDocument“行。 希望它有帮助。

+0

没有。我仍然得到同样的错误.. – Pramodh 2012-08-21 12:15:55

+0

@Pramodh:在我的答案找到编辑部分 – VKGS 2012-08-22 06:14:44

+0

为我工作.......... – 2012-11-18 11:10:16

5

嘿,使用这些代码段。对于XAMPP

路径是:阿帕奇\的conf \额外\的httpd-xampp.conf

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> 
     Order deny,allow 
     Allow 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/HTTP_XAMPP_FORBIDDEN.html.var 
    </LocationMatch> 
+0

谢谢,这对我有用。 – MJoraid 2014-12-13 10:11:24

+0

最受欢迎Joraid – FAISAL 2015-09-06 04:22:38

26

添加到谢卡尔回答

不要忘了重新启动XAMPP服务器

更新接受的答案:

现在你需要评论Require当地

# 
# New XAMPP security concept 
# 
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> 
     #Require local 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 

+0

哇!这对我有用!我认为它的更新版本,我有5.6 – 2015-02-24 15:11:04

2

把后“从所有允许”,你需要重新启动XAMPP应用设置。感谢

0

在XAMPP 5.6.3的Windows 路径C:\ XAMPP的\ apache的\的conf \额外\的httpd-xampp.conf 评论在此:#Require本地

新XAMPP安全观 .. 。 #Require当地 ...

11

如果你看到下面的错误消息,当尝试到phpyAdmin

New XAMPP security concept: 
Access to the requested directory is only available from the local network. 
This setting can be configured in the file "httpd-xampp.conf". 

你可以做下一个(对于XAMPP,部署在UNIX系统上): 您可以尝试为<Directory "/opt/lampp/phpmyadmin">

# vi /opt/lampp/etc/extra/httpd-xampp.conf 

变化配置和更改安全设置,以

#LoadModule perl_module  modules/mod_perl.so 

<Directory "/opt/lampp/phpmyadmin"> 
    AllowOverride AuthConfig Limit 
    Order allow,deny 
    Allow from all 
    Require all granted 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 
</Directory> 

首先 - 评PL模块,第二次更改节点目录的配置。 之后,你应该重新启动httpd守护

# /opt/lampp/xampp restart 

现在您可以访问http://[server_ip]/phpmyadmin/

4

没有为我工作,但下面的事情是真棒:

1)打开

httpd- xampp.conf

这是

的/ opt/LAMPP的/ etc /额外/

2)找到<Directory "/opt/lampp/phpmyadmin">

3)现在只需加要求所有批准之前

4)因此,代码将如下所示
<Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Order allow,deny Allow from all Require all granted </Directory>

5)现在最后用这个命令重启xampp/opt/lampp/lampp restart

就是这样,你已经完成了!

它也适用于xampp。 :)