0

A pretty wired problem occured when configure a virtualhost at port 81.

When I use command curl 123.123.123.123:81 or curl localhost:81 in the same server, it got response. While when I access it from remote machine either by curl 123.123.123.123:81 or browser it does not work, showing error connection time out.

I am using centOS 6.3. Note that I have closed iptables and selinux to test it and I am pretty sure they were both closed.

the remote machine can get access to World Wide Web. Anyone has similar experiences? What happened ?

iptables

when call iptables -L shows:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 
franky
  • 3
  • 3

1 Answers1

0

Something outside your control is blocking port 81. Use Name Based virtual hosting and/or a reverse proxy on port 80 instead.


Your firewall us blocking connections to port 81. You will need to INSERT a rule into your INPUT table to open the port. You should take a look at the documentation for iptables(1). I'm sure you'll find plenty of hep on SF and the wider internet too is you search.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • actually what I first did is modify iptable config file and add an INPUT rule for port 81 right below the rule for port 80. But it still failed, so I tried to close iptable and try again. The wired thing is it still failed then. – franky Jan 22 '16 at 07:31
  • You have either misconfigured iptables or something between the external machine and your server is blocking the port. Show us the output of `iptables -L INPUT -vn` – user9517 Jan 22 '16 at 07:38
  • `Chain INPUT (policy ACCEPT 697 packets, 56024 bytes) pkts bytes target prot opt in out source destination `. Since I close iptables, there is no rule in iptables -L, right? – franky Jan 22 '16 at 07:42
  • here outside means something related to ISP? – franky Jan 22 '16 at 07:46