在/etc/httpd/conf/httpd.conf 最底行加入
NameVirtualHost *:80
<VirtualHost *:80> ServerName 218.6.xx.xx #服务器IP <Location /> Order Allow,Deny Deny from all #如果想通过IP访问,把Deny改成Allow就成 </Location> </VirtualHost>