• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Saturday, September 21, 2013

    Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

    I was getting this error while trying to connect my openfire server with postgresql database. Well let
    me show you the step to fix this error.

    Error:

    Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

    Solution:

    This can happen due to following 2 reason
    • Your Firewall is blocking postgresql from making connection.
    • You have not configured your postgresql database on the server to accept connection from particular machines on the network
    For firewall rules
    # iptables -A INPUT -s 0.0.0.0/0 -p tcp --dport 5432 -j ACCEPT
    # iptables -A INPUT -s 0.0.0.0/0 -p udp --dport 5432 -j ACCEPT

    For postgresql configuration
    # vi /var/lib/pgsql/data/postgresql.conf
    Look out for this line
    listen_addresses = 'localhost'

    and change it to
    listen_addresses = '*'

    Restart the database services
    # service postgresql restart
    Stopping postgresql service:                              
    [  OK  ]
    Starting postgresql service:                               [  OK  ]

    Now try connecting to the postgresql database using openfire. Let me know your success and failure

    Follow the below links for more tutorials

    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to configure Samba 4 Secondary Domain Controller
    How to secure Apache web server in Linux using password (.htaccess)
    How to register Red Hat Linux with RHN (Red Hat Network )
    Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    What is the difference between "su" and "su -" in Linux?
    What is swappiness and how do we change its value?
    How to log iptables messages in different log file
    What are the s and k scripts in the etc rcx.d directories
    How to check all the currently running services in Linux
    How to auto start service after reboot in Linux

    1 comments: