apache 多网站日志配置禁止ip访问

apache关闭栏目浏览

只需要修改Options Indexes为Options None即可,注:根据PHP运行环境安装包的不同,Options Indexes也有可能是Options Indexes FollowSymLinks,一并改为Options None即可。

 

 

#禁止IP访问服务器
AcceptFilter http none
AcceptFilter https none
<VirtualHost 192.168.1.220>
ServerName 192.168.1.220
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>

 

<VirtualHost 121.42.522.525>
ServerName 121.42.52.55
ErrorLog logs/121.42.52.55-error.log
CustomLog logs/121.42.52.55-access.log combined
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>


<VirtualHost 121.42.522.525>
ServerAdmin 346882795@qq.com
DocumentRoot F:/phpStudy/WWW/netshop168
ServerName netshop168.com
ServerAlias www.netshop168.com
ErrorLog logs/netshop168-error.log
CustomLog logs/netshop168-access.log combined
</VirtualHost>

 

或者使用========================下面这种方式

 

Apache的虚拟主机配置

<VirtualHost *:80>
<Location />
Order deny,allow
Deny from all ##屏蔽所有访问
</Location>
</VirtualHost>


 

Listen 81

<VirtualHost *:81 >
DocumentRoot "E:/htdocs/81"
ServerAdmin 346882795@qq.com
ServerName demo.mvidc.cn
<Directory "E:/htdocs/81">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

注意: 注意 <VIrtualHost *:81>必须是星号才行
建一个默认的站点屏蔽所有访问(保证这个站点在所有站点的最前面)

 

posted @ 2016-07-06 11:27  Abner3721  阅读(324)  评论(0编辑  收藏  举报