我在我的Ubuntu服务器上为三个不同的域在apache上定义了三个虚拟主机。如果我禁用两个虚拟主机(a2dissite)并试图在浏览器中解析这两个URL,那么剩下的一个启用站点将解析。
如何配置apache,使禁用虚拟主机的域不解析?
这是如何配置所有3个虚拟主机(信息被屏蔽):
# domain: myfirstdomain.com
# public: /home/me/public/myfirstdomain.com/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@myfirstdomain.com
ServerName www.myfirstdomain.com
ServerAlias myfirstdomain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/me/public/myfirstdomain.com/public
# Log file locations
LogLevel warn
ErrorLog /home/me/public/myfirstdomain.com/log/error.log
CustomLog /home/me/public/myfirstdomain.com/log/access.log combined
</VirtualHost>发布于 2014-08-24 00:44:16
您可以从DNS中删除网站的A记录,然后浏览器无法加载网站。
或者,您可以在您的web服务器上创建一个仅提供空页的默认虚拟主机。
https://serverfault.com/questions/623601
复制相似问题