2017-03-18 19 views
0

これは何度も尋ねられていますが、すべての回答が同じように見えて、phpmyadmin - 禁止されています - このサーバの/ phpmyadmin /にアクセスする権限がありません

localhost以外からphpmyadmin GUIにアクセスしたいとします。

"禁止されています - あなたはこのサーバー上で/ phpmyadmin /にアクセスする権限がありません。"ブラウザに表示されます。

私はCentOS7、Apache 2.4.6、phpMyAdmin-4.4.15.10-1.el7を使用しています。

<Directory /usr/share/phpMyAdmin/> 
    Order Allow,deny 
    Allow from all 
</Directory> 

<Directory /usr/share/phpMyAdmin/setup/> 
    Order Allow,deny 
    Allow from all 
</Directory> 

ほとんどの人は、私はちょうど行うことができます示唆しているようだ:

<IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require all granted 
    </RequireAny> 
</IfModule> 

または:

私はこれを試してみた

<IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require ip 192.168.1.6 
    </RequireAny> 
</IfModule> 

をしかし、それはどれも機能しません。

<Directory /usr/share/phpMyAdmin/> 
    AddDefaultCharset UTF-8 

    <IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require ip 192.168.1.6 
     Require ip ::1 
    </RequireAny> 
    </IfModule> 
    <IfModule !mod_authz_core.c> 
    # Apache 2.2 
    Order Allow,Deny 
    Allow from All 
    Allow from 127.0.0.1 
    Allow from ::1 
    </IfModule> 
</Directory> 

まだ取得:

あなたがこのサーバー上の//phpmyadminのにアクセスする権限がありませんを禁止

これは、現在の状態です。

編集 -

ジャストなどの追加情報は、私は無効にSELinuxを持っているし、正しいを/ usr/share/phpMyAdminの上で必ず許可を作りました。

EDIT AGAIN-私は今これを試してみた

...確かにあなたが得ることができるようになどの基本であると、まだ私はまだエラーを取得

<Directory /usr/share/phpMyAdmin/> 
     Require all granted 
</Directory> 

<Directory /usr/share/phpMyAdmin/setup/> 
     Require all granted 
</Directory> 

答えて

0

これは最終的に機能します。主な問題のトラブルシューティングの方法になっていたいくつかの問題を一度には、...ありました

まず、phpMyAdmin.confを編集...

<Directory /usr/share/phpMyAdmin/> 
    AddDefaultCharset UTF-8 

    <IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require ip 192.168.1.6 
    </RequireAny> 
    </IfModule> 
    <IfModule !mod_authz_core.c> 
    # Apache 2.2 
    Order Deny,Allow 
    Deny from All 
    Allow from 127.0.0.1 
    Allow from ::1 
    </IfModule> 
</Directory> 

OR

<Directory /usr/share/phpMyAdmin/> 
    AddDefaultCharset UTF-8 

    <IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require all granted 
    </RequireAny> 
    </IfModule> 
    <IfModule !mod_authz_core.c> 
    # Apache 2.2 
    Order Deny,Allow 
    Deny from All 
    Allow from 127.0.0.1 
    Allow from ::1 
    </IfModule> 
</Directory> 

また、/ usr/share/phpMyAdminが読めるだけでなく、Apacheユーザーのために実行可能であることも確認する必要があります。何を参照して

<IfModule dir_module> 
    DirectoryIndex index.html index.php 
</IfModule> 

チェックは/ var/log/httpdの/ error_logに:私は再帰的にあなたがまたある/etc/httpd/conf/httpd.confに以下を追加する必要が777

にそれをchmoddedあなたの特定のエラーは各ステップにあります。

3
<Directory /usr/share/phpMyAdmin/> 
    AddDefaultCharset UTF-8 

    <IfModule mod_authz_core.c> 
    # Apache 2.4 
    <RequireAny> 
     Require all granted 
    </RequireAny> 
    </IfModule> 
    <IfModule !mod_authz_core.c> 
    # Apache 2.2 
    Order Allow,Deny 
    Allow from All 
    </IfModule> 
</Directory> 
+1

「すべて許可」がキーでした – Teddy

関連する問題