小编Zer*_*ges的帖子

与机器同名的 Apache2 VirtualHost

我正在使用 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/Linux

Apache/2.4.10 (Debian) 服务器在 server.example.com 端口 80

现在我安装了 apache2 并做了一些基本的配置。然后我/etc/apache2/sites-availablesites-enabled. 一切工作正常,除了VirtualHostServerName 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.htmlmunin文件夹。默认 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 …

virtualhost apache-2.4

6
推荐指数
1
解决办法
1700
查看次数

标签 统计

apache-2.4 ×1

virtualhost ×1