通过服务器IP地址阻止访问者


Answers:


5

我想做的是基于名称的虚拟主机,因此,按照以下思路,您可能会入门:

NameVirtualHost *:80
<VirtualHost *:80>
  <Location />
  Order deny,allow
  Deny from all
  </Location>
  # other configuration for default host...
</VirtualHost>

<VirtualHost *:80>
  # This is the one you would like visible
  ServerName test.local
  <Location />
  Order deny,allow
  Allow from all
  </Location>
</VirtualHost>

(我有点着急,所以即使在那里打错字也很抱歉。)


4
我建议添加一个明确的_default_VirtualHost条目。
gertvdijk 2012年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.