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

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

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

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Apache

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

phpMyAdmin

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

Q&A

解決済

1回答

2267閲覧

phpMyAdminが403エラーで開けない

mayuneco222

総合スコア12

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Apache

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

phpMyAdmin

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

0グッド

0クリップ

投稿2021/04/04 20:11

編集2021/04/10 11:30

phpMyAdminが403Forbiddenになる

前提・実現したいこと

独自ドメインのサブドメインからアクセス(ローカルポート転送)
または、エイリアスでアクセスしたい

現在の環境

CentOS8
Apache/2.4.37 (centos)
MariaDB-server-10.5.9-1
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
phpMyAdmin-5.1.0-2

発生している問題・エラーメッセージ

エイリアスのアドレスにアクセスしてもこうなる。

Forbidden You don't have permission to access this resource.

config.inc.phpの内容

/usr/share/phpMyAdmin/config.inc.phpにあります

php

1<?php 2/** 3 * phpMyAdmin sample configuration, you can use it as base for 4 * manual configuration. For easier setup you can use setup/ 5 * 6 * All directives are explained in documentation in the doc/ folder 7 * or at <https://docs.phpmyadmin.net/>. 8 */ 9 10declare(strict_types=1); 11 12/** 13 * This is needed for cookie based authentication to encrypt password in 14 * cookie. Needs to be 32 chars long. 15 */ 16$cfg['blowfish_secret'] = '********************************'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 17 18/** 19 * Servers configuration 20 */ 21$i = 0; 22 23/** 24 * First server 25 */ 26$i++; 27/* Authentication type */ 28$cfg['Servers'][$i]['auth_type'] = 'cookie'; 29/* Server parameters */ 30$cfg['Servers'][$i]['host'] = 'localhost'; 31$cfg['Servers'][$i]['compress'] = false; 32$cfg['Servers'][$i]['AllowNoPassword'] = false; 33 34/** 35 * phpMyAdmin configuration storage settings. 36 */ 37 38/* User used to manipulate with storage */ 39// $cfg['Servers'][$i]['controlhost'] = ''; 40// $cfg['Servers'][$i]['controlport'] = ''; 41// $cfg['Servers'][$i]['controluser'] = 'pma'; 42// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; 43 44/* Storage database and tables */ 45 $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 46 $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; 47 $cfg['Servers'][$i]['relation'] = 'pma__relation'; 48 $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; 49 $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; 50 $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; 51 $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; 52 $cfg['Servers'][$i]['history'] = 'pma__history'; 53 $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; 54 $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; 55 $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; 56 $cfg['Servers'][$i]['recent'] = 'pma__recent'; 57 $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; 58 $cfg['Servers'][$i]['users'] = 'pma__users'; 59 $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; 60 $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; 61 $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; 62 $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; 63 $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; 64 $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; 65 66/** 67 * End of servers configuration 68 */ 69 70/** 71 * Directories for saving/loading files from server 72 */ 73$cfg['UploadDir'] = '/var/lib/phpMyAdmin/upload'; 74$cfg['SaveDir'] = '/var/lib/phpMyAdmin/save'; 75 76/** 77 * Whether to display icons or text or both icons and text in table row 78 * action segment. Value can be either of 'icons', 'text' or 'both'. 79 * default = 'both' 80 */ 81//$cfg['RowActionType'] = 'icons'; 82 83/** 84 * Defines whether a user should be displayed a "show all (records)" 85 * button in browse mode or not. 86 * default = false 87 */ 88//$cfg['ShowAll'] = true; 89 90/** 91 * Number of rows displayed when browsing a result set. If the result 92 * set contains more rows, "Previous" and "Next". 93 * Possible values: 25, 50, 100, 250, 500 94 * default = 25 95 */ 96//$cfg['MaxRows'] = 50; 97 98/** 99 * Disallow editing of binary fields 100 * valid values are: 101 * false allow editing 102 * 'blob' allow editing except for BLOB fields 103 * 'noblob' disallow editing except for BLOB fields 104 * 'all' disallow editing 105 * default = 'blob' 106 */ 107//$cfg['ProtectBinary'] = false; 108 109/** 110 * Default language to use, if not browser-defined or user-defined 111 * (you find all languages in the locale folder) 112 * uncomment the desired line: 113 * default = 'en' 114 */ 115//$cfg['DefaultLang'] = 'en'; 116//$cfg['DefaultLang'] = 'de'; 117 118/** 119 * How many columns should be used for table display of a database? 120 * (a value larger than 1 results in some information being hidden) 121 * default = 1 122 */ 123//$cfg['PropertiesNumColumns'] = 2; 124 125/** 126 * Set to true if you want DB-based query history.If false, this utilizes 127 * JS-routines to display query history (lost by window close) 128 * 129 * This requires configuration storage enabled, see above. 130 * default = false 131 */ 132//$cfg['QueryHistoryDB'] = true; 133 134/** 135 * When using DB-based query history, how many entries should be kept? 136 * default = 25 137 */ 138//$cfg['QueryHistoryMax'] = 100; 139 140/** 141 * Whether or not to query the user before sending the error report to 142 * the phpMyAdmin team when a JavaScript error occurs 143 * 144 * Available options 145 * ('ask' | 'always' | 'never') 146 * default = 'ask' 147 */ 148//$cfg['SendErrorReports'] = 'always'; 149 150/** 151 * You can find more configuration options in the documentation 152 * in the doc/ folder or at <https://docs.phpmyadmin.net/>. 153 */

phpMyAdmin.confの中身

php

1# phpMyAdmin - Web based MySQL browser written in php 2# 3# Allows only localhost by default 4# 5# But allowing phpMyAdmin to anyone other than localhost should be considered 6# dangerous unless properly secured by SSL 7 8Alias /DBSettings /usr/share/phpMyAdmin 9Alias /dbsettings /usr/share/phpMyAdmin 10 11<Directory /usr/share/phpMyAdmin/> 12 AddDefaultCharset UTF-8 13 AllowOverride all 14 Require all granted 15 SSLRequireSSL 16 17 <IfModule mod_authz_core.c> 18 # Apache 2.4 19 <RequireAny> 20 # Require ip 127.0.0.1 21 # Require ip ::1 22 Require all granted 23 </RequireAny> 24 </IfModule> 25 <IfModule !mod_authz_core.c> 26 # Apache 2.2 27 # Order Deny,Allow 28 # Deny from All 29 # Allow from 127.0.0.1 30 # Allow from ::1 31 # Order Allow,Deny 32 </IfModule> 33</Directory> 34 35<Directory /usr/share/phpMyAdmin/setup/> 36 <IfModule mod_authz_core.c> 37 # Apache 2.4 38 <RequireAny> 39 Require ip 127.0.0.1 10.0.0.0/24 40 Require ip ::1 41 </RequireAny> 42 </IfModule> 43 <IfModule !mod_authz_core.c> 44 # Apache 2.2 45 Order Deny,Allow 46 Deny from All 47 # Allow from 127.0.0.1 48 # Allow from ::1 49 </IfModule> 50</Directory> 51 52#<Directory /usr/share/phpMyAdmin/> 53# AddDefaultCharset UTF-8 54# 55# Require all granted 56#</Directory> 57# 58#<Directory /usr/share/phpMyAdmin/setup/> 59# Require local 60#</Directory> 61# 62# These directories do not require access over HTTP - taken from the original 63# phpMyAdmin upstream tarball 64 65<Directory /usr/share/phpMyAdmin/libraries/> 66 Require all denied 67</Directory> 68 69<Directory /usr/share/phpMyAdmin/templates/> 70 Require all denied 71</Directory> 72 73<Directory /usr/share/phpMyAdmin/setup/lib/> 74 Require all denied 75</Directory> 76 77<Directory /usr/share/phpMyAdmin/setup/frames/> 78 Require all denied 79</Directory> 80 81# This configuration prevents mod_security at phpMyAdmin directories from 82# filtering SQL etc. This may break your mod_security implementation. 83# 84#<IfModule mod_security.c> 85# <Directory /usr/share/phpMyAdmin/> 86# SecRuleInheritance Off 87# </Directory> 88#</IfModule>

試したこと

phpMyAdmin.confに以下を追加

AllowOverride all
Require all granted 

補足情報

サーバーはConohaVPSです。

追記情報(error_log)

80アクセスだと表示されることが確認できました。
443アクセスだと、ERR_SSL_PROTOCOL_ERRORと表示されますので、
おそらくSSL絡みの問題かと思いますが、logにはエラーが残っておらず、
解析のしようがありませんでした。 2021/04/1020時30分 追記

log

1[Sat Apr 10 20:22:51.866026 2021] [suexec:notice] [pid 11032:tid 139914482010432] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) 2[Sat Apr 10 20:22:51.881061 2021] [lbmethod_heartbeat:notice] [pid 11032:tid 139914482010432] AH02282: No slotmem from mod_heartmonitor 3[Sat Apr 10 20:22:51.884152 2021] [mpm_event:notice] [pid 11032:tid 139914482010432] AH00489: Apache/2.4.37 (centos) OpenSSL/1.1.1g configured -- resuming normal operations 4[Sat Apr 10 20:22:51.884180 2021] [core:notice] [pid 11032:tid 139914482010432] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

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

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

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

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

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

TaichiYanagiya

2021/04/07 01:01

そのときの error_log には何か原因が記録されていないでしょうか?
guest

回答1

0

自己解決

Apache、PHP、PhpMyAdminの入れ直しで解決させましたが、
別の問題は生じているため、別質問で上げ直します。

投稿2021/04/10 11:37

mayuneco222

総合スコア12

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問