我的问题是:
前几天我更新了我的Apache,从2.2升级到2.4。我注意到了服务器的奇怪行为。我有一些虚拟主机,它们正常工作。但是,当我尝试打开 localhost 时,我看到了一个虚拟主机,而不是来自文档根目录的“index.php”。
我/ etc / hosts的一部分:
127.0.0.1 localhost
127.0.0.1 crm
127.0.0.1 cp
因此,当我输入 localhost 并按“Enter”时,我会看到 crm 或 cp 主机。
我的 crm vhost :
<VirtualHost *:80>
ServerName crm
DocumentRoot /var/www/odcrm
<Directory /var/www/odcrm>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
答案 0 :(得分:0)
嗯,原因是 - 我的注意力不集中。我忘记启用默认的vHost - 000-default.conf。它首先出现在vHosts列表中, localhost 现在显示正确的内容。