首先下载squid for windows安装包 squid-2.7.STABLE5-bin.zip
然后解压缩,放到C盘squid目录内.
进入目录C:\squid\etc内,将所有文件的.default全部删掉
编辑下squid.conf,将所有内容删掉,替换以下内容,并保存

http_port 80 vhost vport=80
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 1024 MB
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 256 KB
cache_dir ufs c:/squid/var/cache 40960 16 256
cache_swap_low 80
cache_swap_high 97
strip_query_terms off
request_body_max_size 5 MB
memory_pools on
memory_pools_limit 50 MB
access_log none
cache_log none c:/squid/var/logs/cache.log
cache_store_log none
pid_filename c:/squid/var/logs/squid.pid
hosts_file C:\WINDOWS\system32\drivers\etc\hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i .gif 180 20% 10080 override-expire ignore-reload reload-into-ims
refresh_pattern -i .jpg 180 20% 10080 override-expire ignore-reload reload-into-ims
refresh_pattern . 120 50% 1440
acl all src 0.0.0.0/0.0.0.0
acl p-manager proto cache_object
acl s-localhost src 127.0.0.1/255.255.255.255
acl d-localhost dst 127.0.0.0/8
acl d-domains dstdomain sms.reyo.cn
acl p-ssl port 443 563
acl p-safe port 80 443 563
acl m-conn method CONNECT
acl m-purge method PURGE
acl n-maxconn maxconn 15
http_access allow p-manager s-localhost
http_access allow m-purge
http_access allow !p-safe
http_access deny m-conn !p-ssl
http_access deny n-maxconn
http_access allow p-manager
http_access allow d-domains
http_access allow all
http_reply_access allow all
acl r-url urlpath_regex realtime
cache deny r-url
icp_access allow all
follow_x_forwarded_for allow all
acl_uses_indirect_client offrange_offset_limit -1
dns_timeout 2 seconds
forward_timeout 10 seconds
connect_timeout 10 seconds
peer_connect_timeout 6 seconds
read_timeout 10 seconds
request_timeout 6 seconds
persistent_request_timeout 16 seconds
cache_mgr apple@reyo.cn
cache_effective_user nobody
cache_effective_group nobody
visible_hostname sms.reyo.cn
logfile_rotate 0
always_direct allow all
#error_directory /usr/local/squid/share/errors/Simplify_Chinese
coredump_dir c:/squid/var/cache
access_log c:/squid/var/logs/access.log squid
cache_log c:/squid/var/logs/cache.log
cache_store_log c:/squid/var/logs/store.log

打开目录c:\squid\var
新建两个目录,分别为cache和logs

打开CMD,进入c:\squid\sbin目录,执行squid -i 将SQLUID写入服务项
初始化cache目录squid -z 如果配置文件出错的话,初始化cache目录将会出错。
关闭或禁用IIS
在服务里面运行squid
———–到这里,squid部分就搭建成功了

下面开始做域名解析.
打开目录C:\WINDOWS\system32\drivers\etc
用记事本打开hosts编辑并保存
182.141.183.8 sms.reyo.cn

DNSpod大家都会用啦,
把域名NS服务器换到DNSpod上来
然后将电信IP指向61.234.243.31
将网通IP指向218.75.215.11
等A记录生效……..

Squid相关的命令
结束squid进程 /squid/sbin/squid –k shutdown
取得squid运行状态信息:/squid/bin/squidclient -p 80 mgr:info
 取得squid内存使用情况:/squid/bin/squidclient -p 80 mgr:mem
 取得squid已经缓存的列表:/squid/bin/squidclient -p 80 mgrbjects. use it carefully,it may crash
 取得squid的磁盘使用情况:/squid/bin/squidclient -p 80 mgr:diskd
 强制更新某个url:/squid/bin/squidclient -p 80 -m PURGE http://www.hnhack.com/
 查命中率:
 /squid/bin/squidclient -h111.222.111.111 -p80 mgr:info
 /squid/bin/squidclient -h具体的IP -p80 mgr:info

利用Squid + DNSPOD 搭建CDN服务器的更多相关文章

  1. 自己搭建CDN服务器静态内容加速-LuManager CDN使用教程

    为什么要自己来搭建一个CDN服务器实现网站访问加速?一是免费CDN服务稳定性和加速效果都不怎么行:二是用国内的付费CDN服务价格贵得要死,一般的草根站长无法承受:三是最现实的问题国内的CDN要求域名B ...

  2. 用Nginx搭建CDN服务器方法-开启Nginx缓存与镜像,自建图片服务器

    利用Nginx的proxy_cache搭建缓存服务器一:编译ngx_cache_purge1.Nginx的Proxy_cache是根据Key值md5哈希存储缓存,支持任意的Key,例如你可以根据”域名 ...

  3. 使用Nginx反向代理和proxy_cache缓存搭建CDN服务器加快Web访问速度

    碰到问题:移动用户访问web服务器www.osyunwei.com很慢解决办法:1.在移动机房放置一台nginx反向代理服务器2.通过域名DNS智能解析,所有移动用户访问www.osyunwei.co ...

  4. 利用安卓手机搭建WEB服务器

    背景介绍 Android是一种基于Linux的自由及开放源代码的操作系统 所以是用安卓来搭建服务器是完全可行的.接下来将教大家如何利用AndroPHP和Feel FTP(或者其他FTP管理器)来在安卓 ...

  5. 利用云主机搭建MySQL服务器

    前言:有了一台云服务器之后,就想着如何物尽其用.利用其不关机(意外除外)的特性,我们可以在服务器上安装数据库服务,实现云数据库服务器,这样就可以随时随地的访问数据库了,不再受各种限制. 这里以MySQ ...

  6. [Node.js] 2、利用node-git-server快速搭建git服务器

    本文用到了node-git-server 1.检测本地git版本 该包的使用需要机器上本来就安装git,且git的版本大于等于2.7: ╭─root@lt /home/workspace ╰─# gi ...

  7. 利用nodeJs anywhere搭建本地服务器环境

    1.npm install anywhere -g 如果是mac系统会提示你权限不够,需要在代码前加上 sudo获取管理员权限.即sudo npm install anywhere -g. 2.安装完 ...

  8. 利用nodeJs anywhere搭建本地服务器环境【转载】

    首先去nodeJs官网下载最新版nodeJs     https://nodejs.org/en/ 安装成功后win+r打开cmd 输入node -help 或者node -v查看是否安装成功 装好后 ...

  9. 利用apache ftpserver搭建ftp服务器

    操作环境: win2012r2 x64 datacenter Apache FtpServer 1.2.0 Java SE Development Kit 8u333 commons-dbcp2-2. ...

随机推荐

  1. 判断一个字符是否为数字的两种方法(C/C++)

    在平时,我们经常遇见判断字符是否为数字这种题目,虽然感觉还是很简单,不过我是个更喜欢用函数的人,因为我觉得这样更便捷,所以我更推荐第二种方式. 1.直接判断 #include <stdio.h& ...

  2. html-图片热点和网页划区

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. 微信接口问题(The underlying connection was closed: An unexpected error occurred on a send)

    突然在调用微信接口是报:The underlying connection was closed: An unexpected error occurred on a send错误,跟踪了半天,是因为 ...

  4. JOIN从句

    MySQL基础表和数据 -- 5条数据 select * from test_a; -- 8条数据 select * from test_b; 内连接 -- 内连接,join,为inner join的 ...

  5. 【LOJ】 #2025. 「JLOI / SHOI2016」方

    题解 有什么LNOI啊,最后都是JLOI罢了 一道非常--懵逼的统计题 当然是容斥,所有的方案 - 至少有一个点坏掉的正方形 + 至少有两个点坏掉的正方形 - 至少有三个点坏掉的正方形 + 至少有四个 ...

  6. HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException

    在使用Maven工程管理工具整合SSM框架时,Mybatis使用逆向工程生成的pojo,mapper接口及映射文件,把mapper接口和映射文件放在DAO工程的同一级src/main/java目录下. ...

  7. Bootstrap入门七:按钮

    1.可作为按钮使用的标签或元素 为 <a>.<button> 或 <input> 元素添加按钮类(button class)即可使用 Bootstrap 提供的样式 ...

  8. Win10如何配置Jdk环境变量

    对于每一位做Java开发的朋友来说,Jdk是必须要安装的,安装好了Jdk,其实并没有结束,还需要配置Jdk的环境变量,系统在不断地更新,小编给大家介绍一下如何在Win10下配置Jdk,并检测是否配置成 ...

  9. C#语法浮点型字面量

    C#语法浮点型字面量 小数是生活中经常使用的一种数据表示形式.我们日常使用的5.5.0.6都是小数.在编程语言中,这种数据表示方式被称为浮点型数.浮点型数由整数部分.小数部分和小数点组成.浮点型字面量 ...

  10. python线程join

    几个事实 1 python 默认参数创建线程后,不管主线程是否执行完毕,都会等待子线程执行完毕才一起退出,有无join结果一样 2 如果创建线程,并且设置了daemon为true,即thread.se ...