#author("2019-11-23T10:07:27+09:00","default:ryuichi","ryuichi")
* リッスンするIPアドレスの指定 [#b6948c30]


** postgresql.confの修正 [#a6d70233]

 cd /etc/postgresql/9.6/main
 cp postgresql.conf postgresql.conf.$(date +%Y%m%d)
 vi -u NONE postgresql.conf

 ------------------------------------------------
 listen_addresses = 'localhost'
 listen_addresses = '*'
 listen_addresses = '192.168.0.1'
 listen_addresses = '192.168.0.1,192.168.0.2'
 ------------------------------------------------

- *で全インターフェース、,(カンマ)区切りで複数指定できる

** 設定適用(再起動) [#kd94c9ce]

 systemctl restart postgresql

** 補足 [#h321f9f6]

- セキュリティ的なアクセス制御はpg_hba.confで行う

** 参考 [#ua096fcc]

https://stackoverflow.com/questions/9764126/how-to-configure-postgresql-postgresql-conf-listen-addresses-for-multiple-ip-add

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS