AWS: EC2 instance No Data Received - django

I am new to AWS. I set up an instance and deployed a Django App on it by following this tutorial
But when I try to access the instance from the browser via the ip or the public DNS it returns 'No data received', 'ERR_EMPTY_RESPONSE'. Any idea where I am going wrong?

Here are the steps I followed to solve this:
Went to EC2 instances
Click on instance
Go to Security Groups column and click on the security group selected.
In the lower panel, select Inbound > Edit > Add Rule
Under Add Rule, select Type as HTTP and Save.

Related

Tableau cannot connect to redshift server

Tableau cannot connect to the redshift server.
It displayed:
An error occurred while communicating with Amazon Redshift
Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.
Error Code: BC42EF73
could not connect to server: Operation timed out
Is the server running on host "redshift-cluster-1.cncrnka9xarv.us-east-2.redshift.amazonaws.com" (3.143.87.206) and accepting TCP/IP connections on port 5439?
I just followed the setup in AWS Redshift Connection with Tableau - YouTube but it fails. What's the reason?
The first thing you should check is the Security Group associated with the Amazon Redshift database, since the video did not reference it.
The Security Group should permit Inbound access from 0.0.0.0/0 on port 5439. Note that this makes your database accessible to anywhere on the Internet, which is not good from a security perspective. However, I couldn't find a reference to the range of IP addresses that Tableau Online uses.
If that doesn't help, then confirm that the Redshift database is in a public subnet. A public subnet is defined as having a Route Table entry pointing to an Internet Gateway.
Solving this error contains 2 steps:
download the AWS redshift ODBC drive from here
Follow what is given in this answer by #JohnRotenstein.
For doing that follow the following steps:
Go to the cluster with which you want to establish the connection.
Then go to "Properties" tab.
Then below there is a section named "Network and security settings" which has "VPC security group" tab and below that there is a link that will redirect you to Security group of the VPC.
Select the VPC and then select the "inbound rules" tab.
There will be a security group where under "source" there will be something starting with "sg-" which means all the connections to redshift from the internet is blocked and only the addressed with this origin will be able to connect with AWS which are EC2 instances.
There click on "Edit Inbound rules".
In the window that opened up, click the "Add rule" button.
Security group rule ID - This you do not need to set
Type - All traffic
Protocol - All
Port range - All
Source - Anywhere Ipv4(not recommended) so it will be set to "0.0.0.0/0".
Description[optional]
Here set the Source to the IPaddress from where the connection request is going to be made and not the above one.
For all other connection queries can be solved by following this link

Amazon 500150 : Unable to connect to Redshift Cluster

I followed all the steps mentioned on here
to connect to Redshift through Workbench J.
I am not using SSH to connect, so have left SSH settings alone.
When I select Security after selecting Redshift, I see :
Your account does not support the EC2-Classic Platform in this region. Cluster Security Groups are only available when the EC2-Classic Platform is supported. Instead, use VPC Security Groups to control access to your clusters. Go to the EC2 Console to view your VPC Security Groups. For more information, see Amazon Redshift Documentation on Supported Platforms and Managing Clusters in VPC.
My cluster is under a Security Group which has the following Inbound rule :
Type: Redshift
Protocol: TCP
Port Range: 5439
Source: Custom 0.0.0.0/0 (Experimental, just to test,
I will replace this with my IP address)
When I do a Netstat on the host from my machine with -Pn. I get a
Host is up.
PORT STATE SERVICE
5439/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 2.22 seconds
I have already gone through several similar questions and none of these is working for me.
Double check your Security Group settings:
In the Redshift console, go to the Configuration tab.
Click on the link next to VPC security groups
Should take you to Security Groups in the EC2 console with the correct security group selected.
Select the Inbound tab for the security group and click the Edit button (a dialog box opens).
In the dialog box, click the Add Rule button then:
Select Redshift from the Type dropdown menu
Select Anywhere from the Source dropdown menu
Come back and change this to My Ip once your connection works!
Click the Save button (the dialog closes)
You now have 2 new Redshift rules (0.0.0.0/0 AND ::/0)
Then in SQL Workbench's "Select Connection Profile" dialog:
Click "Manage Drivers" at the bottom left and to add the Redshift JDBC driver.
SQL Workbench configures these automatically but check that Classname is like com.amazon.redshift.jdbc42.Driver and Sample URL is jdbc:redshift://host:port/name_of_database.
Next, configure the connection
Select the new Driver you just created from the drop down.
Copy the JDBC URL from the Redshift console Configuration tab and paste it into the URL field.
Must use the correct port: jdbc:redshift://my-cluster.asdfgh5jk8.us-east-1.redshift.amazonaws.com:5439/my-db
Add your Username and Password
Test the connection! (Bottom right)
Please let me know in the comments if this doesn't work for some reason and I'll help you get it working.

I don't understand how to get the realm server running on the AWS AMI

I got AWS running an instance of the AMI service using this ami-80347097 from the Realm website. So I have the EC2 instance up now, but I don't know what to do next. Sorry I'm completely new to this sort of thing.
What would be the server URL for the AWS Instance? And would the admin access token for the Object Server still be the same? Or would I have to do something specific in the EC2 Instance?
TT.TT
EDIT:
Ok so I got the Object dashboard to actually work and I am able to log in.
Thank you very much for helping me with that. My last step is actually getting connected to the Object Server. What would the Server URL for the Object Server be?
I tried using the realm://public URL:9080 for the server URL and got this error Realm Sync Error
Server Connection Problem
Assuming that you have successfully initiated the ami-80347097 instance with realm-object-server service running. At this point make sure you have enabled the 9080 port in your inbound rules section. This is necessary because you are going to access the realm object dashboard with the port enabled.
Steps:
Goto EC2 Dashboard
Select "Securit Group" under "Network & Security"
Click on the security group you have been using for the ami-80347097 instance
Once you have clicked the security group a configuration tab "Description", "Inbound", "Outbound", "Tags" will appear at the bottom of the screen
Add the port 9080 in your Inbound section as a Custom TCP Rule
Once you are done doing this,
Open a new browser window and go to http://localhost:9080. The login page for the Realm Dashboard will be displayed. Remember to replace localhost with the IP address of your server.

What is the most easiest way to configure between AWS server and custom domain

I am trying to hand shaking between my AWS server and domain. I purchased my domain from godday.com. Any one can help me.
First you need to create the static ip of the ec2 instance this is because ec2 ip is volatile every time you restarts ec2 the ip will change .In that case you have to create a static ip so follow the below step Login to your amaazon aws console then :
1.On EC2 Management console you will have a vertical menu on the left hand side.
2.Under “NETWORK & SECURITY” group click on “Elastic IPs”.
3.On the top menu you will see a blue button “Allocate New Address” click on it.
4.Just be sure “EIP used in” is set to “EC2” then click “Yes, Allocate”.
5.A new IP address will be created on the table, select it by clicking on the empty square by the left of the name.
6.Now click on “Associate Address” on the pop-up click on instance and select the instance you would like to associate to this IP.
7.Finally click “Associate” and that’s it. For now to access via SSH, FTP, etc. you will need to use the new elastic IP.
Next you need to point the static ip to the Godaddy domain name. Login to godaddy account:
1.Login into your godaddy account.
2.Under the upper menu click “Domains” and then click “Manage my Domains”.
3.Select the domain you would like to change by clicking the link to the domain on the table under “Domain Name” column.
4.In Domain Details there are three tabs, you should click on “DNS Zone File”.
5.Under A(Host) , click on “Edit Record (pick the one which is "#")” at the end in “Actions” column.
6.Now change the value on the field “Points to” with the elastic ip of your amazon ec2 instance.
Hope that helps you.

How can access AWS RDS by CLI / PUTTY?

I am new to AWS , I can access EC2 user by putty. Like this how can i connect AWS RDS by PUTTY ?
I have AWS RDS Endpoint , If i try like the below
mysql -h testing.cx2wamr3cbzm.us-west-2.rds.amazonaws.com -P 3306 -u Username -p
I am getting some error like
ERROR 2003 (HY000): Can't connect to MySQL server on 'testing.cx2wamr3cbzm.us-west-2.rds.amazonaws.com' (110)
I think there is a problem with security group.I searched more, but its difficult to understand for me.
I want to create database and assign rights ?
Thanks
RDS is not available to the world by default. It's also generally a bad idea to allow access to the RDS from anywhere except from inside your VPC. I recommend you do the following:
Create a security group that allows access to the RDS over port 3306 from your EC2 instance
Visit https://console.aws.amazon.com/ec2/home#s=SecurityGroups and create a new security group.
Switch to the inbound tab and choose MYSQL from the dropdown.
Erase the 0.0.0.0/0 in the source field then click the input field. It will present you with a list of existing security groups. Choose the one that your EC2 instance belongs to.
Click the apply rule changes button
Assign the security group to your RDS
Visit https://console.aws.amazon.com/rds/home#dbinstances: and select your RDS instance and under the Instance Actions menu select Modify
Change the RDS security group to the one you just created
Make sure to select the Apply immediately option at the bottom of this page
Click Continue and apply the new changes. (the change can sometimes take a couple of minutes)
SSH into your EC2 instance then run the mysql command in your question