Pra*_*ngh -1 domain-name-system subdomain apache-2.2
我目前在 linode 上使用 apache 来托管我的网站。我使用了许多子域,每个子域只能通过非 www url 访问。www url 给出 503 错误。
但是,我希望可以从两种类型的 url 访问我的域。制作虚拟站点的典型配置如下所示:-
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin atiprashant@xyz.com
ServerName www.mobiles.xyz.com
ServerAlias mobiles.xyz.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/prashant/public/xyz.com/public/mobiles
# Log file locations
LogLevel warn
ErrorLog /home/prashant/public/xyz.com/public/mobiles/log/error.log
CustomLog /home/prashant/public/xyz.com/public/mobiles/log/access.log combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
linode 的 A/AAAA 记录如下所示:-
谁能告诉我我的方法有什么问题?如果我在提出疑问时不清楚,请发表评论。
谢谢 !
DNS不会自动提供落在记录下您已经定义了一个子域。(即,www.mobiles
即使您已定义,也会返回 NXDOMAIN mobiles
)
有两种方法可以解决这个问题:
mobiles
并且www.mobiles
会有自己的 DNS 记录。*.mobiles
. 这将匹配低于 的记录mobiles
。确保保留现有的mobiles
DNS 记录,因为通配符与基本名称不匹配。 归档时间: |
|
查看次数: |
338 次 |
最近记录: |