访问phpmyadmin提示403禁止访问解决办法

来源:互联网 发布:粤贵银走势k线图软件 编辑:程序博客网 时间:2024/05/16 08:16

</pre>解决办法如下:</p><p>找到你的httpd安装目录。比如我的是/etc/httpd/conf.d,找到里面的phpMyadmin.conf文件,打开修改:</p><p>把Allow from 127.0.0.1全部换成Allow from All。保存。</p><p>重启http,</p><p><pre name="code" class="html">service httpd restart

改后完整的文件如下:

# phpMyAdmin - Web based MySQL browser written in php# # Allows only localhost by default## But allowing phpMyAdmin to anyone other than localhost should be considered# dangerous unless properly secured by SSLAlias /phpMyAdmin /usr/share/phpMyAdminAlias /phpmyadmin /usr/share/phpMyAdmin<Directory /usr/share/phpMyAdmin/>   AddDefaultCharset UTF-8   <IfModule mod_authz_core.c>     # Apache 2.4     <RequireAny>       Require ip 127.0.0.1       Require ip ::1     </RequireAny>   </IfModule>   <IfModule !mod_authz_core.c>     # Apache 2.2     Order Deny,Allow     Deny from All     Allow from All     Allow from ::1   </IfModule></Directory><Directory /usr/share/phpMyAdmin/setup/>   <IfModule mod_authz_core.c>     # Apache 2.4     <RequireAny>       Require ip All       Require ip ::1     </RequireAny>   </IfModule>   <IfModule !mod_authz_core.c>     # Apache 2.2     Order Deny,Allow     Deny from All     Allow from All     Allow from ::1   </IfModule></Directory># These directories do not require access over HTTP - taken from the original# phpMyAdmin upstream tarball#<Directory /usr/share/phpMyAdmin/libraries/>    Order Deny,Allow    Deny from All    Allow from All</Directory><Directory /usr/share/phpMyAdmin/setup/lib/>    Order Deny,Allow    Deny from All    Allow from All</Directory><Directory /usr/share/phpMyAdmin/setup/frames/>    Order Deny,Allow    Deny from All    Allow from All</Directory># This configuration prevents mod_security at phpMyAdmin directories from# filtering SQL etc.  This may break your mod_security implementation.##<IfModule mod_security.c>#    <Directory /usr/share/phpMyAdmin/>#        SecRuleInheritance Off#    </Directory>#</IfModule>


0 0
原创粉丝点击