四種apache禁止使用ip訪問的實現方法方法一
namevirtualhost *:
<virtualhost
: > ==>必需指定這個ip地址
serveradmin
servername
<location />
order denyallow
deny from all
</location>
</virtualhost>
方法二在文件最後面
namevirtualhost
<virtualhost
documentroot "c:/test"
servername
</virtualhost>
<virtualhost
documentroot "c:/web"
servername
</virtualhost>
說明
方法三
servername ipaddress (比如)
documentroot /usr/local/apache/nosite/
這樣就可以了
在/usr/local/apache/nosite/下面建一個index
方法四
servername ipaddress (比如)
documentroot /usr/local/apache/nosite/
order denyallow
deny from all
From:http://tw.wingwit.com/Article/program/Java/gj/201404/30489.html