0
1

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.

CentOS7でPostgreSQLをLANに公開する方法

0
Last updated at Posted at 2019-11-12

設定ファイル「pg_hba.conf」で認証方法を設定

※「host」と各「all」の定義はこのファイルのコメントに記載されています。
下記の設定で、
・TCP/IPで
・すべてのデータベースへ
・すべてのユーザから
・すべてのアドレスから
・「trust」という認証方法で
接続可能になります。

pg_hba.conf
・・・(略)・・・
# IPv4 local connections:
host    all             all             all            trust
・・・(略)・・・

設定ファイル「postgresql.conf」でネットワークを設定

下記の設定で
・ポート5432
・すべてのアドレス
を監視するになります。

postgresql.conf
・・・(略)・・・
# - Connection Settings -
listen_addresses = '*'          # what IP address(es) to listen on;
port = 5432                     # (change requires restart)
・・・(略)・・・

ファイアウォールの設定

[root@centos7 data]# firewall-cmd --add-service=postgresql --zone=public --permanent
success
[root@centos7 data]# firewall-cmd --reload
success
0
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?