1

I've created a new instance of Apache's httpd process on my development server for testing purposes. The machine is running Centos 6.8.

I'm able to connect to the web server locally through curl but unable to connect externally.

# curl 127.0.0.1:1500
    {"message":"Hello World!"}

I've updated my iptables to allow new TCP connections over port 1500 - currently my rules are as follows:

# iptables -nL
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:1500

    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination

    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination

I've also tried allowing access through SELinux:

# semanage port -l | grep 1500
    http_port_t                    tcp      1500, 8080, 80, 81, 443, 488, 8008, 8009, 8443, 9000

Any assistance in debugging this issue would be greatly appreciated, as I'm not sure what else to try.

Edit as per Simon's comment:

# netstat -nlp | grep 1500
    tcp        0      0 :::1500                     :::*                       LISTEN      23117/httpd_dev
3
  • 1
    What is the output of netstat -nlp | grep 80? Jan 3, 2018 at 16:56
  • 2
    What is the problem you are having? You need to be specific. Jan 3, 2018 at 16:57
  • @SimonGreenwood, the apache server is actually running on 1500 - I've updated the main post to contain the output.
    – user450531
    Jan 3, 2018 at 17:00

1 Answer 1

0

It seems (from the comments) that an upstream GCP firewall is blocking access.


Check and see if you httpd server is listening on your external IP address, something like

netstat -tnlp | grep :1500

Should give an output like

tcp      0    0 :::1500                :::*                  LISTEN  2295/httpd

If it's listening on all addresses If it's only listening on 127.0.0.1 the you'll see something like

tcp      0    0 127.0.0.1:25           0.0.0.0:*             LISTEN      2297/httpd

and you should adjust the listen directive in your httpd configuration appropriately.

7
  • I've updated the main post to contain the output of the first command. It appears to be configured correctly.
    – user450531
    Jan 3, 2018 at 17:02
  • What is the exact error message you are getting from whatever it is you are trying to connect to your server with.
    – user9517
    Jan 3, 2018 at 17:03
  • No connection is established resulting in a time out.
    – user450531
    Jan 3, 2018 at 17:05
  • Then you are connecting to the wrong IP address or there is an upstream firewall causing problems.
    – user9517
    Jan 3, 2018 at 17:05
  • I have the correct IP address, and I am unaware of any upstream firewalls (Google Compute cloud system). I have other instances of Apache running on this server which is why I'm using port 1500 - perhaps this port is being blocked because it's non standard? I'll try setting it to something else.
    – user450531
    Jan 3, 2018 at 17:08

You must log in to answer this question.