質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

Q&A

解決済

1回答

1360閲覧

phpadminにログインしようとすると、ログイン画面の前に403エラーが出ます。【シングルドメインではできました】

chiangmai48

総合スコア13

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

0グッド

0クリップ

投稿2019/01/11 11:15

編集2019/01/12 11:34

phpadminにログインしようとすると、ログイン画面の前に403エラーが出ます。
シングルドメインでは、動作して、マルチドメインにして、ディレクトリ分岐したらおかしくなりました。
apache、phpまでは動いています。
エラーメッセージやログを検索しまくって解決を試みましたが解決できないのでここに質問を書きます。

環境:さくらのVPS
OS:cent-os 7.6.1810
apache:2.4.6
php:7.1.25

/etc/httpd/conf.d/phpMyadmin.confの中

Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 #Require local Require all granted </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> <Directory /usr/share/phpMyAdmin/setup/> <IfModule mod_authz_core.c> # Apache 2.4 Require local </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> # 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 None </Directory> <Directory /usr/share/phpMyAdmin/setup/lib/> Order Deny,Allow Deny from All Allow from None </Directory> <Directory /usr/share/phpMyAdmin/setup/frames/> Order Deny,Allow Deny from All Allow from None </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>

ここまでシングルドメインで、apacheのルートディレクトリを/var/www/html/の状態にした時は動作したのですが、マルチドメインにして、/var/www/html/●●●、/var/www/html/○○○、/var/www/html/△△△と/etc/httpd/conf.d/vhost.confを作成して、マルチドメインにしたところ、phpまでは動作したものの、phpadminは404エラーになってしまいます。

エラーメッセージやエラーログからはディレクトリ関係がおかしいところまではわかったのですが、これ以上どうして良いかわかりません。

宜しく、ご教授頂けると幸いです。

ブラウザのエラーメッセージ

Forbidden You don't have permission to access /phpmyadmin/ on this server.

エラーログ

Sat Jan 12 20:29:54.079347 2019] [autoindex:error] [pid ] [client ] AH01276: Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

おそらく、<VirtualDomain> 設定で DirectoryIndex index.html と上書き設定しているのではないでしょうか。
URL のパスを /phpmyadmin/index.php とファイル名を付けてアクセスするか、DirectoryIndex index.html index.php とするといいと思います。

投稿2019/01/14 06:42

TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

chiangmai48

2019/01/14 10:58 編集

上記、vhhostの設定に、index.html index.phpとやりましたら無事に動作しました。 有難うございます。 【編集】 私の勘違いでした。どのドメインでも正常動作しました。 有難うございました。 ほんとに、奥が深いものです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問