Can ping apache server, but cannot access any other way

6,672

Solution 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

Solution 2

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.

Share:
6,672

Related videos on Youtube

A. Powell
Author by

A. Powell

Updated on September 18, 2022

Comments

  • A. Powell
    A. Powell over 1 year

    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.

    • pa4080
      pa4080 almost 6 years
      Try to open port 80 and 22 (http/ssh) in your firewall.
    • A. Powell
      A. Powell almost 6 years
      They are open on the firewall and forwarded on the router.
  • A. Powell
    A. Powell almost 6 years
    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.