LoginSignup
1
1

More than 5 years have passed since last update.

CentOS7 apache2.4 でphpmyAdminをインストールしたらForbiddenが半日治らなかった件

Last updated at Posted at 2017-10-02

参考記事がたくさんヒットしたのに、まったく治らなくて発狂しそうになりましたが、

・apacheのバージョンによって権限を開く記述が違う
・記述を追記する場所も違う

上記がポイントでした。

==================

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

< Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
AllowOverride all <----ここにこの記述を追加!
Require all granted  <----ここにこの記述を追加!

# Apache 2.4

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 127.0.0.1
Allow from ::1
</IfModule>
</Directory>

==================

apache2.2だとAllow from Allみたいな記述でしたが、
2.4だと
AllowOverride all
Require all granted
になるということが分かるまでに1時間くらいかかった^^;

さらにそこから記述場所でひっかかりまして。
(の中に書いちゃってた)
プログラムの文をちゃんと理解していないのが問題^^;
<Directory /usr/share/phpMyAdmin/>の下に書いてあげたら、
phpmyadminのログイン画面でました。やっほーい。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1