我在Namecheap上购买了一个便宜的域名。它托管在AWS EC2 Linux Ubuntu实例上。我通过Route 53进行了设置。根域可以正常工作。
我想做的是让子域正常工作,例如apex.rootdomain.com,而我遇到的麻烦比我想象的要多得多。我认为这比设置根域要容易得多(由于发现了一篇很棒的文章,实际上这很简单)。
这是我的apache2.conf:
<Directory /html/root>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /html/apex>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
这是我在etc / apache2 / sites-available / MyConfig.conf中的配置文件:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /html/root
ServerName www.root.com
ServerAlias root.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName apex.root.com
DocumentRoot "/html/apex"
</VirtualHost>
我相信My apache2.conf和MyConfig.conf都是正确的,因为它们适用于我的主域。
这是我在Route 53上设置子域的方法:
只需添加一下,我等待了大约2或3天,以查看问题是否可以解决,但还没有解决。 Namecheap表示,更改生效不到48小时。
编辑:区域文件
root.com的托管区域
NAME TYPE VALUE
root.com. A Elastic-IP
root.com. NS Domain-Name-A.
Domain-Name-B.
Domain-Name-C.
Domain-Name-D.
root.com. SOA some values that I don't think matter
www.root.com. A Elastic-IP
apex.root.com A Elastic-IP
名称服务器:域名-A,域名-B,域名-C,域名-D,域名-E,域名-F,域名-G,域名- Name-H在Namecheap上被列为“名称服务器”。
这是我的Namecheap设置的样子:
NameServers
Customs DNS
- Domain-Name-A
- Domain-Name-B
- Domain-Name-C
- Domain-Name-D
答案 0 :(得分:1)
假设root.com和www.root.com在您当前的配置中正常工作,则如下所示:
root.com. A Elastic-IP
www.root.com. A Elastic-IP
apex.root.com. A Elastic-IP
请记住,在用于您的DNS的GoDaddy上,如下所示:
@ A Elastic-IP
www A Elastic-IP
apex A Elastic-IP