如何在Amazon EC2上为应用设置自定义域?

时间:2023-01-26 12:47:09

I am new in the Amazon EC2 world, I just created an app, that is located URL like this:

我是亚马逊EC2世界的新手,我刚刚创建了一个应用程序,它位于这样的URL:

http://ec2-54-123-45-678.compute-1.amazonaws.com:8080

This is generated URL by Amazon EC2.

这是由Amazon EC2生成的URL。

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

现在我需要使用自己的域名,所以当我访问www.my-domain-name.com时,我希望看到来自的内容

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?

我在Godaddy上买了域名。有没有办法在Amazon AWS仪表板中执行此操作,还是需要在Godaddy系统中进行设置?

Thanks

谢谢

3 个解决方案

#1


13  

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

在Amazon中,我创建了一个实例,并将IP与该实例相关联。您可以通过输入亚马逊网址来访问它

如何在Amazon EC2上为应用设置自定义域?

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

我实际上使用Media Temple而不是GoDaddy,但它会是类似的。我去了区域文件并将该公共URL添加到www

如何在Amazon EC2上为应用设置自定义域?

And as you can see, here is my blog actually working on the custom domain.

正如您所看到的,这是我的博客实际上在自定义域上工作。

如何在Amazon EC2上为应用设置自定义域?

I set the wildcard because that way, no matter what someone types, if it is not set, then they will still see the site.

我设置了通配符,因为这样,无论有人输入什么,如果没有设置,那么他们仍然会看到该网站。

如何在Amazon EC2上为应用设置自定义域?

EDIT

编辑

For the root URL you should be entering your elastic IP and setting that as an A record.

对于根URL,您应该输入弹性IP并将其设置为A记录。

#2


7  

First you need to set an ElasticIP for associated to that instance.

首先,您需要设置与该实例关联的ElasticIP。

Then point the DNS entry of "www" for "my-domain-name.com" to the IP assigned in the step above.

然后将“my-domain-name.com”的“www”的DNS条目指向上述步骤中指定的IP。

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.

管理DNS的地方是另一回事,可以在GoDaddy或AWS Route53中。您必须在“my-domain-name.com”寄存器中调整委托DNS。例如:您的域名可以在GoDaddy注册,但其委托DNS指向Route53,因此您可以从AWS控制台管理域名。

#3


-1  

In order to setup DNS mapping you can map the existing IP 54.123.45.678 to ex: www.my-domain-name.com.

要设置DNS映射,您可以将现有IP 54.123.45.678映射到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.

但是,当您运行运行在8080的tomcat时,您需要使用Apache将请求转发给tomcat。这样你就可以在没有端口8080的情况下访问www.my-domain-name.com。如果你使用linux box安装Apache,apache-modjk然后配置站点。

#1


13  

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

在Amazon中,我创建了一个实例,并将IP与该实例相关联。您可以通过输入亚马逊网址来访问它

如何在Amazon EC2上为应用设置自定义域?

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

我实际上使用Media Temple而不是GoDaddy,但它会是类似的。我去了区域文件并将该公共URL添加到www

如何在Amazon EC2上为应用设置自定义域?

And as you can see, here is my blog actually working on the custom domain.

正如您所看到的,这是我的博客实际上在自定义域上工作。

如何在Amazon EC2上为应用设置自定义域?

I set the wildcard because that way, no matter what someone types, if it is not set, then they will still see the site.

我设置了通配符,因为这样,无论有人输入什么,如果没有设置,那么他们仍然会看到该网站。

如何在Amazon EC2上为应用设置自定义域?

EDIT

编辑

For the root URL you should be entering your elastic IP and setting that as an A record.

对于根URL,您应该输入弹性IP并将其设置为A记录。

#2


7  

First you need to set an ElasticIP for associated to that instance.

首先,您需要设置与该实例关联的ElasticIP。

Then point the DNS entry of "www" for "my-domain-name.com" to the IP assigned in the step above.

然后将“my-domain-name.com”的“www”的DNS条目指向上述步骤中指定的IP。

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.

管理DNS的地方是另一回事,可以在GoDaddy或AWS Route53中。您必须在“my-domain-name.com”寄存器中调整委托DNS。例如:您的域名可以在GoDaddy注册,但其委托DNS指向Route53,因此您可以从AWS控制台管理域名。

#3


-1  

In order to setup DNS mapping you can map the existing IP 54.123.45.678 to ex: www.my-domain-name.com.

要设置DNS映射,您可以将现有IP 54.123.45.678映射到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.

但是,当您运行运行在8080的tomcat时,您需要使用Apache将请求转发给tomcat。这样你就可以在没有端口8080的情况下访问www.my-domain-name.com。如果你使用linux box安装Apache,apache-modjk然后配置站点。