25 配置防盗链

curl -x127.0.0.1:80 -I -e "http://qq.com/123.txt" http://123.com/jt

curl -x127.0.0.1:80 -I -e "http://123.com/123.txt" http://123.com/jt 两条语句效果一样,防盗链不启作用,不知道是那里出错了。 前面没加文件后缀名,所以不生效。 把文件jt改成jt.jpg,就可以了,

26 访问控制Directory

 <Directory /data/wwwroot/123.com>
       Order deny,allow
       Deny from all
       Allow from 127.0.0.1
    </Directory>
[root@martinlinux001 123.com]# curl -x192.168.31.91:80 -I 123.com/admin/index.html
curl: (7) Failed connect to 192.168.31.91:80; 拒绝连接
[root@martinlinux001 123.com]# curl -x127.0.0.1:80 -I 123.com/admin/index.html
HTTP/1.1 200 OK
Date: Thu, 08 Mar 2018 09:51:09 GMT
Server: Apache/2.4.29 (Unix) PHP/7.1.6
Last-Modified: Wed, 07 Mar 2018 16:06:37 GMT
ETag: "6-566d4be6e8d1c"
Accept-Ranges: bytes
Content-Length: 6
Content-Type: text/html

[root@martinlinux001 123.com]# curl -x192.168.31.141:80 -I 123.com/admin/index.html
HTTP/1.1 403 Forbidden
Date: Thu, 08 Mar 2018 09:51:30 GMT
Server: Apache/2.4.29 (Unix) PHP/7.1.6
Content-Type: text/html; charset=iso-8859-1

27 访问控制FilesMatch