Dns 无法使用bitnami.conf运行多个子域

Dns 无法使用bitnami.conf运行多个子域,dns,apache2,subdomain,bitnami,Dns,Apache2,Subdomain,Bitnami,我正在尝试运行2个子主和1个域。以下是网址: example.com app1.example.com app2.example.com 我为所有指向默认IP地址的文件创建了A记录 这是我的bitnami.conf文件 ServerName example.com <VirtualHost *:80> ServerName example.com DocumentRoot /opt/bitnami/apache2/htdocs/default_we

我正在尝试运行2个子主和1个域。以下是网址:

example.com

app1.example.com

app2.example.com

我为所有指向默认IP地址的文件创建了
A
记录

这是我的
bitnami.conf
文件

ServerName example.com

<VirtualHost *:80>

        ServerName example.com
        DocumentRoot /opt/bitnami/apache2/htdocs/default_website
</VirtualHost>

<VirtualHost *:80>

        DocumentRoot /opt/bitnami/apache2/htdocs/app1_website
        ServerName app1.example.com
</VirtualHost>

<VirtualHost *:80>

        DocumentRoot /opt/bitnami/apache2/htdocs/app2_website
        ServerName app2.example.com
</VirtualHost>
在浏览器中访问
app1.example.com
时,出现以下错误:

example.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
app1.example.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
 Forbidden
 You don't have permission to access / on this server.
当我在浏览器中访问app2.example.com时,我得到以下错误:

example.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
app1.example.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
 Forbidden
 You don't have permission to access / on this server.
我对
bitnami
apache2
非常陌生。我犯了什么错误

更新:

这是我更新的
bitnami.conf
文件:

 <VirtualHost *:80>

    ServerName example.com
       <Directory /opt/bitnami/apache2/htdocs/default_website>
                                     DirectoryIndex index.html
                                     AllowOverride All
                                     Require all granted
                     </Directory>

    DocumentRoot /opt/bitnami/apache2/htdocs/default_website
 </VirtualHost>
 <VirtualHost *:80>

    DocumentRoot /opt/bitnami/apache2/htdocs/app1_website
    <Directory /opt/bitnami/apache2/htdocs/app1_website>
                                     DirectoryIndex index.html
                                     AllowOverride All
                                     Require all granted
                     </Directory>
    ServerName app1.example.com
 </VirtualHost>
 <VirtualHost *:80>

    DocumentRoot /opt/bitnami/apache2/htdocs/app2_website
     <Directory /opt/bitnami/apache2/htdocs/app2_website>
                                     DirectoryIndex index.html
                                     AllowOverride All
                                     Require all granted
                     </Directory>
    ServerName app2.example.com
</VirtualHost>

ServerName example.com
DirectoryIndex.html
允许超越所有
要求所有授权
DocumentRoot/opt/bitnami/apache2/htdocs/default\u网站
DocumentRoot/opt/bitnami/apache2/htdocs/app1_网站
DirectoryIndex.html
允许超越所有
要求所有授权
ServerName app1.example.com
DocumentRoot/opt/bitnami/apache2/htdocs/app2_网站
DirectoryIndex.html
允许超越所有
要求所有授权
ServerName app2.example.com

我可以访问
app2.example.com
,但不能访问其他两个URL

serveralias
是您缺少的


将serveralias添加到每个Virtualhost配置中。别名应该是每个主机所需的确切子域。

serveralias
是您缺少的


将serveralias添加到每个Virtualhost配置中。别名应该是每个主机所需的确切子域。

您的域未正确配置@points-to-ip address、app1-points-to-ip address、app2-points-to-ip address。当我输入ip地址时,默认的\u网站正在加载
DNS\u PROBE\u FINISHED\u NXDOMAIN
意味着它没有指向任何东西,因此您的域没有正确配置,或者DNS服务器还没有传播(
NXDOMAIN
=>
不存在的域
),是否有可能一个子域被传播,而其他子域没有?我在更改
.conf
2小时前更新了NS服务器file@FlashThunder我用了
https://dnschecker.org
用于检查传播的工具。它显示URL指向正确的ip地址。我删除了所有的A记录并再次添加它们。现在所有3个网站都显示相同的错误。可能是什么问题?您的域未正确配置@指向ip地址,app1指向ip地址,app2指向ip地址。当我输入ip地址时,默认的\u网站正在加载
DNS\u PROBE\u FINISHED\u NXDOMAIN
意味着它没有指向任何东西,因此您的域没有正确配置,或者DNS服务器还没有传播(
NXDOMAIN
=>
不存在的域
),是否有可能一个子域被传播,而其他子域没有?我在更改
.conf
2小时前更新了NS服务器file@FlashThunder我用了
https://dnschecker.org
用于检查传播的工具。它显示URL指向正确的ip地址。我删除了所有的A记录并再次添加它们。现在所有3个网站都显示相同的错误。有什么问题吗?