1

I have a Wt application running in a CentOS server machine(Machine A) in the port number 9798. Application is up and I could view the web page with the URL,

http://localhost:9798

But application is not loading up in another machine(Machine B) in the same network with the URL,

http://<ip of server>:9798

The port is open and listening.

Same thing happens with the PostgreSQL which is running in the server machine. I'm unable to connect to PostgreSQL from other machine through PgAdmin III.

But reverse is happening, I am able to connect to the Application and PostgreSQL from Machine A to Machine B.

I double checked the running ports, PostgreSQL settings, etc., but could not figure out why is this happening.

Why is this happening, what should I try now to explore?

Machine A = CentOS 6.4 server,
Machine B = Ubuntu 12.04 Desktop

  • Your programs might be configured to only listen for local connections, have you checked for this? Possibly related question: Cannot connect to postgres from remote host – lk- May 26 '14 at 10:31
  • "But application is not loading up". Details? Error message? Is it a timeout? Connection refused? Other? – Craig Ringer May 26 '14 at 11:12
  • It is a web application... "Web Page is not available" - same kind of error if application is not running or like trying to access any website without internet connection... – Manoj G May 26 '14 at 11:17
4

Run the following command to see the ports are open in the firewall:

sudo iptables -L

If you don't see the ports listed follow the instructions in this : http://wiki.centos.org/HowTos/Network/IPTables

If they are listed you need to enable remote access for postgres: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html

  • Thanks for you response. I have enabled remote access for postgres already. But did not see ports listed in iptables. But adding iptalbe rules also did not help :( – Manoj G May 27 '14 at 4:59
  • Not only postgres, could not access anything outside to the server, in the web page including Wt application, python's simple http server, etc even after changing the rules of iptables. – Manoj G May 27 '14 at 5:02
  • @ManojG Try running the following command from the second machine: nc <machine1_ip> <port_number> – Amged Rustom May 27 '14 at 5:12
  • I tried. nc <machine1_ip> <port> did not give any result. But nc <machine2_ip> <port> from machine1 works properly. It establishes connection and transfers messages also... – Manoj G May 27 '14 at 5:30
  • 1
    Then its the firewall, because there is no other service that prevents a remote connections from all the ports. Make sure you added the rules correctly. Plus in CentOS changed rules need to be saved so if you didn't run the save command and you rebooted the machine you will need to add the rules again. – Amged Rustom May 27 '14 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.