Using an existing address for another server - web-services

Suppose that I have an account on a server with an address http://www.xxx.xxx/~account.
Because of some restriction on the server xxx.xxx, I set up a new AWS server with my own domain http://my.domain.xxx.
However, it looks like the new domain doesn't sufficiently represent my identity, so I was wondering if I could assign the address http://www.xxx.xxx/~account to the AWS server.
Is this possible? If so, how can I do that?

Set the A record of your www.xxx.xxx to the IP of the EC2 server hosting your website and set up a Virtual Host in your web server configuration to handle requests for that domain name.

Related

ALB access logs request initiator domain

is there any way to retrieve the user client domain from the ALB access logs?
from AWS documantation there is a 'domain_name' attribute but it is indicates the requested server domain rather than the client domain.
i know that in nginx there is a domain attribute which indicates the domain of the client,
is there a way to retrieve client domain from the alb?.
As you've pointed out, ALB access logs do not provide client's dns name. Instead they return:
client:port - The IP address and port of the requesting client.
Thus, to get the domain name of the client, you would have to parse the logs, and "manually" get the domain based on the IP. For example, if python is used, there is gethostbyaddr which can be useful in getting the domain name from an IP address.

SSL for default Amazon EC2 domain

I'm running a EC2 instance with Amazon Linux. My public URL is like :
my-url-prefix.us-west-2.compute.amazonaws.com
. I need SSL for a specific reason. My question is this:
Is there any way to add SSL for the domain "my-url-prefix.us-west-2.compute.amazonaws.com"? What is the process of doing so?
Like OpenShift.com, is there any way of getting a HTTPS for the ec2 instance? Like https://the-maevjay.rhcloud.com/
No.
Amazon owns the amazonaws.com domain. So you cannot obtain an SSL certificate for that URL. Doing so would defeat the purpose of the certificate authority.
As Matt Houser answered, you can't obtain an SSL certificate for the amazonaws.com domain. You need to obtain a domain and get the certificate for that.
Per the official docs:
"If you plan to use your EC2 instance to host a public web site, you need to register a domain name for your web server or transfer an existing domain name to your Amazon EC2 host."
If you have a domain, the process isn't exactly straightforward but is well documented. Assuming you are using Apache Web Server, you can follow the instructions from here:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html

Route53 Subdomain Creation with IP address and Port Number

We are using route53 AWS service to create a sub domain from our hosted zone. We have an instance currently running on amazon server with Elastic IP. Once we create route53 record of type A we can only assign the Elastic IP of our instance. This will map to apache default page as port 80 is used as default port with given IP address.
In our scenario we have multiple services running on same instance and we want to use a service runing on port 8153. Our requirments is to map this port automatically with our subdomain. So when we type say "ci.yyyyy.com" it will automatically map to that service running on 8153 port. All these steps should be done by using terraform scripts.
Is there any way to map IP address and port number with sub domain? Any suggestion and comments will be appreciated.
Thanks
This does not belong to route53 but you can achieve this using a reverse proxy in front of your servers. e.g use Squid in front of your webserver and redirect based on the domain name from the url. In Squid you can achieve this using cache_peer_access
See this question where you see a pretty nice diagram
EDIT: I propose Squid here, but you can find any other reverse proxy tool, like Nginx for example if you prefer

Amazon EC2 instance hosting

I have a application hosted in amazon EC2 instance. My application runs at http://ec2...compute-1.amazonaws.com/index.html. We also have a domain registered as sovan.test.com. WE want to use Route53 for redirect/open http://ec2...compute URL when user used the registered domain name. How can we do this?
We are getting an error that we can not host anything with index as back. and also it do not detect http:.
Please give some advice.
Thanks
Amazon Route53 is a Domain Name Service, which can resolve names into IP addresses. For example, if a user types www.foo.com, it can return the IP address of a web server of load balancer that will respond to a request.
Note that is only resolves the domain, which is the initial part of an address. It does not resolve the path portion of a URL. For example, going to www.foo.com/index.html will result in resolving www.foo.com to an IP address, then sending a request for the index.html page to that server. The index.html portion is not part of the DNS resolution.

How to set up custom domain for an app on Amazon EC2?

I am new in the Amazon EC2 world, I just created an app, that is located URL like this:
http://ec2-54-123-45-678.compute-1.amazonaws.com:8080
This is generated URL by Amazon EC2.
Now I would need to use my own domain name, so when I would access www.my-domain-name.com, I would like to see the content from
http://ec2-54-123-45-678.compute-1.amazonaws.com:8080
I bought the domain name on Godaddy.
Is there any way to do this in Amazon AWS dashboard or do I need to set it up in Godaddy system?
Thanks
I am answering on a more general level because I stumbled upon this thread when setting my custom domain.
In Amazon I created an instance and associated an IP to that instance. You were able to access it by typing in the amazon url
I actually used Media Temple not GoDaddy, but it will be similar. I went to the zone file and added that public url to the www
And as you can see, here is my blog actually working on the custom domain.
I set the wildcard because that way, no matter what someone types, if it is not set, then they will still see the site.
EDIT
For the root URL you should be entering your elastic IP and setting that as an A record.
First you need to set an ElasticIP for associated to that instance.
Then point the DNS entry of "www" for "my-domain-name.com" to the IP assigned in the step above.
Where you manage your DNS is another thing, can be in GoDaddy or in AWS Route53. You must adjust the delegation DNS in the "my-domain-name.com" register. Ex: your domain can be registered with GoDaddy but its delegation DNS point to Route53 so you can manage the domain from your AWS Console.
In order to setup DNS mapping you can map the existing IP 54.123.45.678 to ex: www.my-domain-name.com.
However, as you are running tomcat which is running at 8080 you need to forward the the request to the tomcat using Apache. So that you can visit www.my-domain-name.com without port 8080. If you are using linux box install Apache, apache-modjk and then configure sites.