3

I have a question which I hope somebody can answer for me.

My situation: I have an Ubuntu Server running Apache2 on a EC2 Amazon instance, which is serving an OwnCloud instance.

My goal: I want to deploy HTTPS on this instance. I already configured the security group to allow HTTPS traffic from anywhere (as the server should be accessible from anywhere on the internet). We already have a domain name bar.com registered at another domain hosting company. But we want to point foo.bar.com to this owncloud installation.

My questions:

1) Which IP-address do I use to configure the DNS at this domain hosting company. Because the public ip-address and public DNS of the EC2 instance is renewed every time the instance restarts.

2) How do I generate the SSL certificate for HTTPS configuration of Apache2? More specifically, which common name (CN) do I need to put in the certificate. Because the public dns of the EC2 instance is changing on every restart. I think if I put the foo.bar.com CN in the certificate that the browser will throw a certificate error once the user gets redirected from foo.bar.com -> .compute.amazonaws.com, am I right?

In short: how do I deploy https on a EC2 instance at Amazon AWS with a dns at a third party domain name service?

0

1 Answer 1

5

Read the VPC docs! You can configure your EC2 instance to get the same public ip address on every restart.

Even if your ip address changes the CN is just the domain name. Use an A record on your DNS server to point to the public IP of the EC2 instance and the browser wont get redirected. It will resolve foo.bar.com to your EC2 instance public IP.

Note that Route53 can automatically map your EC2 instance public IP to DNS records.

2
  • Thanks a lot for this answer. Just one question remains, what do I put in the certificate signing request for CN? The public dns of my EC2 instance? But this changes every restart? or can I just put foo.bar.com? And the solution you are referring for a static public ip is the elastic ip solution of amazon?
    – Dario Incalza
    Feb 6, 2015 at 11:16
  • 1
    Yes, its the elastic ip see this for more info. The CN is the domain name you are planning to use e.g. foo.bar.com. You shouldn't use the ec2 public dns at all.
    – Mawi12345
    Feb 6, 2015 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .