houjinkai 2020-01-03
[ ~]# cd /usr/local/nginx/ [ nginx]# ls client_body_temp fastcgi_temp logs sbin uwsgi_temp conf html proxy_temp scgi_temp [ nginx]# cd html/ [ html]# ls 50x.html index.html qq.jpg [ html]# mount.cifs //192.168.254.10/linuxs /abc Password for //192.168.254.10/linuxs: [ html]# cd /abc [ abc]# ls error.png [ abc]# cp error.png /usr/local/nginx/html/ [ abc]# cd - /usr/local/nginx/html [ html]# ls 50x.html error.png index.html qq.jpg [ html]# grep "qq.jpg" index.html <img src="qq.jpg"> [ html]# service nginx start [ html]# netstat -natp | grep 80 tcp 0 0 192.168.247.193:80 0.0.0.0:* LISTEN 3038/nginx: master
使用域名,需要使用dns解析服务
搭建dns详见我前面的博客
然后指定盗链主机和客户机的dns服务器
开始设置盗机
在win10内打开控制面板,控制面板内打开程序和功能,里面有开启或者关闭功能,点击
然后点击internet informatoion servers
关闭盗机防火墙
然后客户端去访问盗机网站
盗链成功,接下来做防盗链操作:
[ html]# vim /usr/local/nginx/conf/nginx.conf location ~*\.(jpg|gif|swf)$ { valid_referers none blocked *.shl.com shl.com; if ( $invalid_referer ) { rewrite ^/ http://www.shl.com/error.png; } }
重启nginx服务
[ named]# service nginx stop [ named]# service nginx start
防盗链配置成功
FPM优化参数调整示例
[ ~]# vim /usr/local/php/etc/php-fpm.conf pid = run/php-fpm.pid pm = dynamic pm.max_children=20 pm.static_servers = 5 pm.min_spare_servers = 2 pm.max_spare_servers = 8