{"id":122,"date":"2017-10-02T16:33:40","date_gmt":"2017-10-02T14:33:40","guid":{"rendered":"http:\/\/blog.chloesoe.ch\/?p=122"},"modified":"2017-10-02T16:56:20","modified_gmt":"2017-10-02T14:56:20","slug":"allow-access-to-postgresql-from-outside","status":"publish","type":"post","link":"https:\/\/blog.chloesoe.ch\/?p=122","title":{"rendered":"allow access to postgresql from outside"},"content":{"rendered":"<p>With this steps you can configure PostgreSQL to accept connections from the LAN on Port 5432.<\/p>\n<ol>\n<li>\n         edit <strong>\/var\/lib\/pgsql\/data\/postgresql.conf<\/strong><br \/>\n         <samp>listen_addresses = '*'<\/samp>\n<\/li>\n<li>edit <strong>\/var\/lib\/pgsql\/data\/pg_hba.conf<\/strong> add the network you want to allow like: host all all 192.168.190.0\/24 md5 <br \/>\n    The file looks then like:<\/p>\n<pre><code># \"local\" is for Unix domain socket connections only\r\nlocal   all             all                                     trust\r\n# IPv4 local connections:\r\nhost    all             all             127.0.0.1\/32            md5\r\nhost    all             all             192.168.190.0\/24        md5\r\n# IPv6 local connections:\r\nhost    all             all             ::1\/128                 md5\r\n<\/code><\/pre>\n<\/li>\n<li>    reload postgresql<br \/>\n    <samp>systemctl restart postgresql.service<\/samp>\n<\/li>\n<li>    check connection with pgAdmin or an other tool<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>With this steps you can configure PostgreSQL to accept connections from the LAN on Port 5432. edit \/var\/lib\/pgsql\/data\/postgresql.conf listen_addresses = &#8216;*&#8217; edit \/var\/lib\/pgsql\/data\/pg_hba.conf add the network you want to allow like: host all all 192.168.190.0\/24 md5 The file looks then like: # &#8220;local&#8221; is for Unix domain socket connections only local all all trust #&#8230; <a href=\"https:\/\/blog.chloesoe.ch\/?p=122\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">allow access to postgresql from outside<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-postgresql"],"_links":{"self":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=122"}],"version-history":[{"count":12,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}