Running Apache 2.4.12 on Ubuntu. If issue a telnet 127.0.0.1 80 all seems to be running.
If I issue " curl 127.0.0.1 example.com and wget 127.0.0.1 example all seems to be running. But, if on my client laptop put an entry in the host file pointing to to Linux server and a domain e.g. 192.168.1.50 example.com from a browser if I enter
http://example.com the browser returns "Unable to connect"
I have turned the firewall off using "ufw disable" still no change. I can ping example.com from client as it responds as expected.
See output below from telnet to 127.0.0.1 80 and issuing GET /HTTP 1.1 and curl 127.0.0.1 example.com
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET / HTTP 1.1
HTTP/1.1 404 Not Found
Date: Tue, 26 Jan 2016 22:06:57 GMT
Server: Apache/2.4.12 (Ubuntu)
Content-Length: 276
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at GisRoad.home Port 80</address>
</body></html>
Connection closed by foreign host.
pauls@GisRoad:~$
pauls@GisRoad:~$ curl 127.0.0.1 example.com
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
<hr>
<address>Apache/2.4.12 (Ubuntu) Server at 127.0.0.1 Port 80</address>
</body></html>
<html>
<head>
<title>Welcome to Example.com!</title>
</head>
<body>
<h1>Success! The example.com virtual host is working!</h1>
</body>
</html>
telnet 192.168.1.50:80
However... telnet does not speak HTTP so you are not likely to get a usable response. curl and wget do speak HTTP.
http://curl.haxx.se/docs/manual.html
https://www.gnu.org/software/wget/manual/wget.html#Invoking