My problem is that there is a PostgreSQL Server in one datacenter, and a php based website in another data center. Okay, that’s great for remote access via ssh. Please support the nixCraft with a PayPal donation or Patreon. Keeping the site online is challenging, with everyone blocking Ads □. nixCraft is a one-person show, and many of you use Adblocker. □ Was this helpful? Please add a comment to show your appreciation or feedback. Join the nixCraft community via RSS Feed or Email Newsletter. He wrote more than 7k+ posts and helped numerous readers to master IT topics. Vivek Gite is the founder of nixCraft, the oldest running blog about Linux and open source. => man page: pgsql and configuration file $ psql -h 10.10.29.50 -U vivek -d sales Further readings: Connect to remote server using IP address 10.10.29.50 and login using vivek username and sales database, enter: # /etc/init.d/iptables restart Step # 6: Test your setup Make sure iptables is not blocking communication, open port 5432 (append rules to your iptables scripts or file /etc/sysconfig/iptables): iptables -A INPUT -p tcp -s 0/0 -sport 1024:65535 -d 10.10.29.50 -dport 5432 -m state -state NEW,ESTABLISHED -j ACCEPT # /etc/init.d/postgresql restart Step # 5: Iptables firewall rules Open config file, enter:īind and open TCP/IP port by setting tcpip_socket to true. Step #3a – Information for old version 7.x or olderįollowing configuration only required for PostgreSQL version 7.x or older. Next set IP address(es) to listen on you can use comma-separated list of addresses defaults to ‘localhost’, and ‘*’ is all ip address: # vi /etc/postgresql/8.2/main/nfįind configuration line that read as follows: You need to open PostgreSQL configuration file /var/lib/pgsql/data/nf or /etc/postgresql/8.2/main/nf. If you are using PostgreSQL version 8.x or newer use the following instructions or skip to Step # 3a for older version (7.x or older). Use either step #3 or #3a as per your PostgreSQL database server version. Step # 2: Enable networking for PostgreSQL Make sure you replace 10.10.29.0/24 with actual network IP address range of the clients system in your own network. $ vi /etc/postgresql/8.2/main/pg_hba.confĪppend the following configuration lines to give access to 10.10.29.0/24 network: Login as postgres user using su / sudo command, enter: Once connected, you need edit the PostgreSQL configuration file, edit the PostgreSQL configuration file /var/lib/pgsql/data/pg_hba.conf (or /etc/postgresql/8.2/main/pg_hba.conf for latest 8.2 version) using a text editor such as vi. $ ssh Step # 2: Enable client authentication Login over ssh to remote PostgreSQL database server: Step # 1: Login over ssh if server is outside your IDC
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |