0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AdminerのアクセスIP制御

Posted at

バージョンアップで↓こちらの方法が使えなくなっていたので

Adminerでお手軽DB管理&アクセス制御


adminer本体は公開されていない階層に置き、別のPHPファイルを作成します。

adminer_ext.php
<?php
$acl = [//↓アクセスを許可するIPを指定
	'::1',	//localhost
	'xxx.xxx.xxx.xxx',
];

if(!in_array($_SERVER['REMOTE_ADDR'], $acl)){
	header("HTTP/1.0 404 Not Found");
	exit;
}

require '../adminer-4.7.1-mysql.php';

作成したPHPファイルを公開ディレクトリに置くことで、アクセス制御のコードを通してからadminerを表示できます。

https://www.adminer.org/en/plugins/#use
プラグインなども同じ方法で読み込むようです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?