我正在使用 Debian 的具有规范名称的服务器(/etc/hostname在反向 DNS 中定义)server.example.com
root@server:~# uname -a
Linux server.example.com 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/LinuxApache/2.4.10 (Debian) 服务器在 server.example.com 端口 80
现在我安装了 apache2 并做了一些基本的配置。然后我/etc/apache2/sites-available在sites-enabled. 一切工作正常,除了VirtualHost有ServerName server.example.com。当我尝试在资源管理器中访问该 URI 时,我获得了默认虚拟主机的内容(未ServerName指定)。如果我将server.example.com.conf的 ServerName更改为不同的内容(如test.example.com)并重新加载 apache 配置,那么我可以毫无问题地访问 URI。我想知道 VirtualHostServerName与机器的规范名称相同有什么问题。
此外,server.example.com.conf还有DocumentRoot /var/www/subs/server其中包含index.html和munin文件夹。默认 VirtualHost 中DocumentRoot /var/www/html没有munin文件夹。但是,当我尝试访问时,http://server.example.com/munin我可以进入/var/www/subs/server/munin, whilehttp://server.example.com/index.html带我/var/www/html/index.html …