1

When I try to ping my apache2 server (running on Ubuntu Server 16.04) with its domain name, it succeeds from any computer.

However, if I try to access it with a browser, or use ssh, the server is not found. Curling doesn't even give an error message, even if I wait a while.

I have a static ip set behind a router. When I curl localhost I get the expected result. When I curl or ping any website other than the server itself I get the expected result.

This problem appeared after adding dns servers to the network configuration file. However, removing that line does not fix the issue, even after multiple reboots.

Edit: I checked that the correct ports were open on the router, the firewall, and used netstat to check that apache was listening on the correct ports.

  • 2
    Try to open port 80 and 22 (http/ssh) in your firewall. – pa4080 May 30 '18 at 7:06
  • 2
    They are open on the firewall and forwarded on the router. – A. Powell May 30 '18 at 13:53
1

Did you ever try checking the ports with nmap?

nmap -sT <IP-ADRESS>

should show the ports on the server.

e.g.

nmap -sT XXX.XXX.XXX.XXX

Starting Nmap 7.01 ( https://nmap.org ) at 2018-05-30 00:06 CEST
Nmap scan report for XXX.XXX.XXX.XXX
Host is up (0.034s latency).
Not shown: 990 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
53/tcp   open  domain
80/tcp   open  http
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
2002/tcp open  globe
5060/tcp open  sip
8089/tcp open  unknown
8181/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 3.84 seconds
  • The result with the public ip was "Host seems down. If it is really up, but blocking our ping probes, try -Pn". I tried that, and it just hung for a couple of minutes before I ended it. When I run it using the local ip address it says ssh, http, and https are open. – A. Powell May 30 '18 at 13:59
1

The problem was that the IP address changed. Apparently I didn't properly set that up somehow. I could ping because I was pinging some random other computer. If I figure out what was wrong with that I'll add it to this question.

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.