为什么子域显示主页而不是 Apache 配置中配置的路径?

Why subdomain shows the home page not the path configured in the Apache config?

提问人:Martin AJ 提问时间:8/14/2023 最后编辑:Martin AJ 更新时间:8/14/2023 访问量:23

问:

为了添加子域,我在 DNS 服务器中添加了一条记录,现在也有 ping(在定义该 A 记录之前它没有 ping)。panelApanel.lamtakama.com

另外,我在Apache配置文件中添加了一个新的。以下是完整的 Apache 配置:VirtualHost

<VirtualHost *:80>
        ServerName lamtakam.com
        ServerAlias www.lamtakam.com

        ServerAdmin [email protected]
        DocumentRoot /var/www/html/myweb

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        AllowEncodedSlashes NoDecode
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =www.lamtakam.com [OR]
        RewriteCond %{SERVER_NAME} =lamtakam.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<Directory /var/www/html/myweb>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

<VirtualHost *:80>                       # ----------- From here down ----------- 
        ServerName panel.lamtakam.com
        ServerAlias panel.lamtakam.com

        ServerAdmin [email protected]
        DocumentRoot /var/www/panel/public

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

并重新启动 .问题是,子域向我显示主页。我的意思是,它不执行文件。apache2panel.lamtakam.comlamtakam.com/var/www/panel/public/index.php

知道怎么了吗?

Apache Ubuntu 子域

评论


答: 暂无答案