dragonSam
By:
dragonSam

Had setup LAMP server, my application is supposed to receive request from a server in Kenya. But it gives 404 error on the other side

July 24, 2017 438 views
Apache Ubuntu 16.04

Had setup LAMP server on Ubuntu 16.04, my application is supposed to receive request from a server in Kenya. Whenever the server in Kenya sends request at my sever, then I don't receive any request and on their side they get error:
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Can anyone help what is the reason?

6 Answers

Hi @dragonSam

Most likely address they are using in Kenya is wrong. Check the full address again and paste it again in the Kenya server.

If you're using a domain, then make sure there is no hosts changes.
Run ping yourdomain.com on your computer and on the Kenya server. IP should be the same.

If there's a login system, then that could be causing the issue. Try visiting the address with a browser in incognito mode.

[deleted]
  • @dragonSam

    You're getting a response from a different server. I don't know what you're running on the server in Kenya, but I can see it's a Windows Server replying (Server: Microsoft-IIS/7.5), which is definitely not the same as your droplet running Apache.

    If you just use a regular browser (Chrome) on the server in Kenya, which website shows up if you visit http://104.131.77.15 or http://www.topladylingerie.co.ke/ ?

Hi @hansen

I appreciate that you took time to reply. I tried what you have suggested, but still issue not resolved.
I forgot to provide the error which is generated on Kenya server. Have a look, might help in getting things clear.

Here is error and the response Kenya server is receiving:

2017-07-24 12:39:42|ERROR|response|SOAP|validation|NewTest|SAG:10.5.38.40|504021500931707241239429507002||60027|A service error occurred. Maybe http message illegal or analyse failed!|888777|888777000|OA:,DA:254713167623|2017-07-24 12:39:42|NodeInfo=NodeType:20,NodeID:1;TransType=Pay Bill;TransID=LGO319BAUR;BusinessShortCode=902026;internalerrorcode=60027;internalerrordesc=A service error occurred. Maybe http message illegal or analyse failed!;apiid=0|
Content=0001050b:SA receive validation response message[sessionID:871] from NewTest[104.131.77.15] failed! Cost time : 221 ms.

HTTP/1.1 404 Not Found
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Mon, 24 Jul 2017 09:38:49 GMT
Connection: close
Content-Length: 1245

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">

</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>404 - File or directory not found.</h2>
<h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
</fieldset></div>
</div>
</body>

hi @hansen and @all

got something for you, this is what is the reply for "ping 104.131.77.15" on server in Kenya.

<1006 tbroker [sag] :/home/sag/log/sa-1/run>ping 104.131.77.15
PING 104.131.77.15 (104.131.77.15) 56(84) bytes of data.
64 bytes from 104.131.77.15: icmpseq=1 ttl=255 time=0.147 ms
64 bytes from 104.131.77.15: icmp
seq=2 ttl=255 time=0.166 ms
64 bytes from 104.131.77.15: icmpseq=3 ttl=255 time=0.135 ms
64 bytes from 104.131.77.15: icmp
seq=4 ttl=255 time=0.143 ms
64 bytes from 104.131.77.15: icmpseq=5 ttl=255 time=0.167 ms
64 bytes from 104.131.77.15: icmp
seq=6 ttl=255 time=0.159 ms
64 bytes from 104.131.77.15: icmp_seq=7 ttl=255 time=0.125 ms

--- 104.131.77.15 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 5999ms
rtt min/avg/max/mdev = 0.125/0.148/0.167/0.021 ms

As per additional info: I am using Ubuntu 16.04 32-bit.

And is there any role of firewall on my OS which might be letting such issue?

  • @dragonSam

    The problem is not your server, it's the server in Kenya. Something is taking over the connection and I don't know if it's censorship or ISP-blocking or some other bad configuration.

    On the Kenya-server run the following. The curl command might have a very big output, but you can use www.pastebin.com to store the output:

    # If mtr is not installed, then install it first
    mtr www.topladylingerie.co.ke
    
    curl http://www.topladylingerie.co.ke/
    

    But without HTTPS on your website, anyone and anything in between you and the server in Kenya could intercept the traffic and change it. May I recommend that you add HTTPS to Apache:
    https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04

    This tutorial will show you how to set up a free TLS/SSL certificate from Let’s Encrypt on a Ubuntu 16.04 server running Apache as web server. TLS certificates are used within web servers to encrypt the traffic between server and client, providing extra security for users accessing your application.
    • @hansen

      sure will go consider the above options.

      Untill I try this, I would like to tell that yesterday I had tested by triggering request from another server (which is hosted on BlueHost) to http://www.topladylingerie.co.ke/ for the purpose of replicating the scenario.
      Then i received the response back from it... why not here i got the same issue?

      Both don't use https

Hello @hansen

well i have installed the certs, but the company in Kenya required to verify the "http" requests first then it will move to "https".
I have also created a support ticket support ticket for the same, but it seems that support reply comes on a particular time only.

I can say that I was able to receive some of the requests on my end, but every request. As you already have provide much of the information, can you suggest anything else which can help to end this once and for all.

Thank You

@hansen

I had finally got them to run the curl command.

<1006 tbroker [sag] :/home/sag>curl http://www.topladylingerie.co.ke/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>403 - Forbidden: Access is denied.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>403 - Forbidden: Access is denied.</h2>
  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
 </fieldset></div>
</div>
</body>
</html>



<1007 tbroker [sag] :/home/sag>curl 104.131.77.15
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>403 - Forbidden: Access is denied.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>403 - Forbidden: Access is denied.</h2>
  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
 </fieldset></div>
</div>
</body>
</html>


<1004 tbroker [sag] :/home/sag>curl https://topladylingerie.co.ke
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). The default
 bundle is named curl-ca-bundle.crt; you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

But when I ran these commands on some other server then I got the response showing content of the homepage of the website.

What might be the reason for this?

Have another answer? Share your knowledge.