如何禁用 Apache 的主服务器功能?

Ogu*_*gic 5 virtualhost apache-2.2

这个文件

Due to the fact that www.example1.com is first in the configuration file, 
it has the highest priority and can be seen as the default or primary server. 
That means that if a request is received that does not match one of the specified 
ServerName directives, it will be served by this first VirtualHost.
Run Code Online (Sandbox Code Playgroud)

如何禁用此功能,如果任何启用的虚拟主机不匹配,我不希望 apache 提供任何文件?

Sha*_*den 7

只需让您的第<VirtualHost>一个拒绝任何请求即可。

<VirtualHost *:80>
    ServerName i-dont-want-your-requests
    Order allow,deny
    Deny from all
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)