troubleshooting Question

Unable to Connect to web Site - running apache server - curl and wget returns postive results

Avatar of ccfcfc
ccfcfcFlag for United Kingdom of Great Britain and Northern Ireland asked on
Active DirectoryApache Web ServerLinux
6 Comments1 Solution541 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
Andy S

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros