省略虛擬主機配置

省略虛擬主機配置

我在 Centos 上設定了 apache 2.4,以從兩個虛擬主機提供 index.html,但無論 url 中的連接埠如何,apache 始終從 stepan.wudangtc.cz 提供 index.html。我可能理解得很不好,或者配置錯誤。請告訴我如何設定 apache 來提供來自 vhost pavel.wudangtc.cz 的 index.html 服務。 Apache 同時監聽埠 80 和 8080。

<VirtualHost *:80>
    ServerName pavel.wudangTC.cz
    ServerAlias wudangTC.cz
    DocumentRoot /aplikace/httpd/docroots/pavel

    <Directory /aplikace/httpd/docroots/pavel>
            Require all granted
    </Directory>

</VirtualHost>

<VirtualHost *:8080>
   ServerName stepan.wudangTC.cz
   ServerAlias www.wudangTC.cz
   DocumentRoot /aplikace/httpd/docroots/stepan

   <Directory /aplikace/httpd/docroots/stepan>
           Require all granted
   </Directory>

</VirtualHost>

相關內容