Can't connect to specific domain from ec2 linux instance - amazon-web-services

I'm trying to connect from an ec2 micro instance to the following domain: http://www.bnm.gov.my but it seems to be blocked.
I have tried doing a simple request using curl.
curl http://www.bnm.gov.my
which gives me the following error:
curl: (7) Failed to connect to www.bnm.gov.my port 80: Connection timed out
I tried wget
wget http://www.bnm.gov.my
and get the following error:
--2018-10-31 14:33:06-- http://www.bnm.gov.my/
Resolving www.bnm.gov.my (www.bnm.gov.my)... 103.6.236.129
Connecting to www.bnm.gov.my (www.bnm.gov.my)|103.6.236.129|:80... failed: Connection timed out.
Retrying.
Also, a traceroute times out.
I can access the website from my computer as well as websites like downforeveryoneorjustme dot com and uptrends to check if there are any issues with the website but it seems to be my amazon instance.
I have access to internet, I can request other websites using curl... but this particular one isn't working...
I appreciate any ideas you may have as to how to fix this!
Current ACL Configuration for VPC. (The instance is running within a VPC)
Outbound
Rule # Type Protocol Port Range Destination Allow/Deny
100 All IPv4 traffic all all 0.0.0.0/0 ALLOW
* All IPv4 traffic all all 0.0.0.0/0 DENY

Related

Can't run GCP VM on public IP with SSH

I am setting up a Virtual Machine node.js server at Google Cloud Platform. I have set up SSH keys so that I can log into my VM. I can successfully log into my VM using SSH-in-browser and start my server.
I can't access my public IP address through Chrome. I get this message:
This site can’t provide a secure connection.
When I try to connect to the IP within SSH-in-browser, I get the following:
$ curl -vso /dev/null --connect-timeout 5 34.68.254.120:8080
* Trying 34.68.254.120:8080...
* connect to 34.68.254.120 port 8080 failed: Connection refused
* Failed to connect to 34.68.254.120 port 8080: Connection refused
* Closing connection 0
I'm new at this. Any ideas would be appreciated. Thanks!
Edit1: Some more details --
Linux VM
port 8080 ingress is open on the firewall
I'm using OSLogin (`enable-oslogin = TRUE' 'enable-oslogin-sk = FALSE')
I can successfully log into console with both SSH-in-Browser and PuTTY, and I can start my server on port 8080
In both, I get the error above when I try to connect to the IP address
EDIT:
Follow below steps to fix “This Site Can’t Provide a Secure Connection” Error :
This error typically indicates a problem with either your browser’s configuration or the SSL certificate on your site.
1) Your local environment doesn’t have an SSL certificate.
2) Outdated SSL caches in the browser : (This is one of the more popular causes. Web browsers store SSL certificates in a cache, much
like other data. This means they don’t have to verify the certificate
every time you visit a site, which speeds up browsing. However, if
your SSL certificate changes and the browser is still loading an
older, cached version, it can cause this error to pop up).
3) Incorrect time and date settings on your computer.
4) Rogue browser extensions.
5) Overzealous antivirus software.
6) An invalid or expired SSL certificate.
If your firewall rules prevent external access:
Check your firewall rules with the following command: gcloud compute firewall-rules list with this, you can review the VPC where
the VM instance was migrated; and if it has allowed the Ingress TCP:
22 Port.
If this firewall rule is missing, you can add the firewall rule in the GCP console -> VPC Networks ->select your VPC network _Click on
the firewall rules to double check that the tcp: 22 port is allowed.
If the issue still is ongoing after checking the firewall rules, you
can follow this guide to start troubleshooting SSH connection.

aws ubuntu instance Failed to connect to bitbucket.org port 443: Connection timed out

I have access to aws ubuntu inance via SSH key.
I am trying to clone my Github or bitbucket repo, but it is always failed fired this error:
Failed to connect to bitbucket.org port 443: Connection timed out
Even I tried to download something with wget but it is failed.
What is the possible issue for this?
can anyone please help me in this case?
This could be caused for a number of reasons please check the following:
Outbound access for your security group allows access to port 443.
NACLs have correctly configured to include both port 443 and the ephemeral ports.
Your route tables have been configured appropriately with either an internet gateway (if your host is public) or NAT Gateway/NAT instance (if your instance is private).

Amazon EC2 HTTP connection refused, but HTTP port is open

I created a new Ubuntu T2 Micro instance on EC2.
Created a new Elastic IP and selected "EIP used in: VPC"
Associated the address to my new EC2 Ubuntu instance.
I now have a Private IP and a Public/Elastic IP. No Public DNS.
My security group has SSH port 22 and HTTP port 80 open.
I can connect to the instance just fine through SSH using the Public IP, but when I try to browse to the Public IP through the browser it says connection refused. I can't ping it either.
I'm out of ideas.
Amazon EC2 HTTP connection refused, but HTTP port is open
That's already proven by the fact that you got 'connection refused'. If the port wasn't open it would have been 'connect timeout'.
'Connection refused' means that the service you tried to connect to wasn't listening at that port. Possibly it isn't started at all, or even installed.
You need to install a web server on your machine, such as Apache or Nginx. This is not provided by default in EC2.
go to security groups --> edit inbound rules --> add rule (add a custom TCP port 8888 with 0.0.0.0/0 ).
There are two major things that can happen to your web server.
Connection refused :- Which means there is no service running (http/JBOSS/nginx) on your server which is available to accept connections on port specified (which is 80 in this case)
Connection timed out :- Would mean server is not able to process any incoming connection hitting it at port 80. Once you fix the security group and your NACL (if you don't have a default one), then you need to re-check to see if it's service which is giving out the error, not to forget that the error response will change.

How can I find out the reason of 'request timed out' on AWS?

I can't access my website suddenly hosted on AWS EC2. ping example.com gets the following result:
PING example.com
Pinging example.com [xx.xx.xx.xx] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
PS: the security group associated with my instance is as follows:
Ports Protocol Source launch-wizard-2
22 tcp 0.0.0.0/0 ✔
80 tcp 0.0.0.0/0 ✔
443 tcp 0.0.0.0/0 ✔
I can't connect to my instance using ssh as well (can't access log file). All what I can do is to check the EC2 dashboard aws.amazon.com. Everything looks fine.
In Status Checks,
System Status Checks System reachability check passed Instance
Status Checks Instance reachability check passed
Here is a screenshot.
How can I find out the reason?
PS: the last backup file downloaded to dropbox is backwpup_b9aba0_2015-07-12_03-03-25.tar.gz.
EDITT: Now it works. I guess that the issue is caused by the limitation of CPU credits (t2.micro) but I am not sure.
Just a guess, but your security group (firewall) may not allow ICMP requests? You will probably need to enable icmp traffic for the pings to succeed. The same goes for SSH. If port 22 is not open you won't be able to connect.
The reason is that I host an OSQA site under the same instance and dozens of spammers on OSQA keep posting poker-related questions, which consumes almost all CPU credits.

Curl amazon EC2 instance getting error

Hi I have been using Amazon Ec2 server and I am trying to call to this server using curl from another server(php) which is hosted in godaddy.
While calling I am getting the below error
Error: "Failed to connect to ec2-**-**-**-**.us-west-2.compute.amazonaws.com port 8080: Connection refused" - Code: 7
Can anyone tell me about what is the actual issue.
Note: While trying to connect this through rest api tool it is working fine.
Make sure, the security group for the ec2 instances has the inbound rule from Goddaddy's IP range or set to all (0.0.0.0/0) with port 80 and 443.