标签:生效 apache tor directory www. oca director pac data
一:配置防盗链打开虚拟主机配置文件
#vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
添加以下内容
SetEnvIfNoCase Referer "^http://.*\.abc\.com" local_ref
SetEnvIfNoCase Referer ".*.aminglinux.com" local_ref
SetEnvIfNoCase Referer "^$" local_ref #没有referer,直接地址
<filesmatch ".(txt|doc|mp3|zip|rar|jpg|gif|png)">
Order Allow,Deny
Allow from env=local_ref
</filesmatch>
配置文件内容
<Directory /data/wwwroot/www.123.com/admin/>
Order deny,allow #按顺序执行,最后的生效
Denu from all
Allow from 127.0.0.1
</Directory>
配置文件内容
<Directory /data/wwwroot/www.123.com/admin/>
<FilesMatch admin.php(.*)>
Order deny,allow #按顺序执行,最后的生效
Denu from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>
apache配置防盗链、访问控制directory、访问控制FilesMatch
标签:生效 apache tor directory www. oca director pac data
原文地址:http://blog.51cto.com/10941098/2155452