• Welcome to LiuJason's Blog!

CloudFlare (CF) CDN安装并配置Railgun服务端教程|CentOS|Debian|Ubuntu

Linux笔记 Jason 4 years ago (2020-05-24) 1102 Views 2 Comments QR code of this page
文章目录[隐藏]

前言

Railgun这个功能是CloudFlare的Biz以上订阅才有的功能哟!不过这个功能也下放给了CloudFlare Partner(CFP),所以可以联系愿意给Railgun权限的CFP索要激活token自己部署,来实现网站加速功能。典型网站案例:V2EX,效果还是很明显的。
这里推荐云筏科技提供的免费CFP:https://cf.cloudraft.cn 加Q群可以索要token:768412349

更多骚操作:

CloudFlare (CF) CDN开通伪Biz服务 Railgun|WAF|30PageRules|Pollish|Mirage

文章目录[隐藏] 声明 实现步骤 功能介绍 声明 说是biz,其实是阉割版的,功能(具体介绍看后面): Railgun 30条 PageRules CloudFlare WAF 定制错误页 Polish Mirage 实时流量分析 这种利用bug的方案不知道能有效多久,反正大家且撸且珍惜。 实现步骤 1. 先加个愿意给Railgun服务的CF Partner,接入域名,如果已经接入的要删除后再接入 例如云筏科技提供的免费CF Partner接入服务:https://cf.cloudraft.cn 2. 找CFP管理员要来railgun的token,部署railgun服务(保留好token,以后自己可以换服务器部署,不会失效) 安装方法看这里:https://www.cloudflare.com/docs/railgun/installation.html 3. 让CFP管理员给这个域名分配自己的railgun服务 4. 去CloudFlare官网查看是否添加成功 成功后是会在CF的后台看到这样的界面,可以选择开启或关闭,测试一下 5. 去CloudFlare官网删掉这个域名 6. 去有开通CF ServerShield Plus服务的Plesk,添加域名,开启服务 例如: https://www.cloudraft.cn/aff.php?aff=217&gid=19 终身8折优惠码59UQLYE9M0 购买后根据图文教程操作即可:https://doc.cloudraft.cn/products/cdn/cloudflare/quickstart 大功告成!去CloudFlare看看有没有生效吧~ 功能介绍 Railgun 这个功能是Biz以上才有的哟! 当内容快速变化或个性化时,其无法通过传统方式缓存,并且请求必须发送到源服务器进行处理。远离源服务器的访问者在更大程度上会受这些延迟的影响。 Railgun 通过压缩和 WAN 网络优化 Cloudflare 数据中心与源服务器之间的通信,来加速和保护动态内容的传递,从而加快无法直接从 Cloudflare 缓存提供的请求。 Railgun 通过以下方式缩短页面加载时间: […]

Railgun简介(官方)

当内容快速变化或个性化时,其无法通过传统方式缓存,并且请求必须发送到源服务器进行处理。远离源服务器的访问者在更大程度上会受这些延迟的影响。
Railgun 通过压缩和 WAN 网络优化 Cloudflare 数据中心与源服务器之间的通信,来加速和保护动态内容的传递,从而加快无法直接从 Cloudflare 缓存提供的请求。
Railgun 通过以下方式缩短页面加载时间:

  • 通过跟踪页面版本之间的差异(精确至字节)压缩内容,仅发送实际已更改的部分。
  • 维护多个同步请求的单个持久连接,从而消除网络连接延迟。
  • 缓存经常变化或个性化的动态内容。

Cloudflare Railgun
Railgun 由两个软件组件组成:Listener 和 Sender。
Railgun Sender 安装在所有 Cloudflare 数据中心内,并与 Railgun Listener 保持连接。
Railgun Listener 通常安装在源服务器网络中您的 Web 主机上。它是在标准服务器上运行的一个小型软件,使用加密的二进制 Railgun 协议为来自 Cloudflare 的请求服务。

教程正文

原版教程点击这里查看:https://www.cloudflare.com/docs/railgun/installation.html
这里简化一下,直接放代码:

CentOS6

sudo rpm --import https://pkg.cloudflare.com/pubkey.gpg
sudo rpm -e gpg-pubkey-8e5f9a5d-*
sudo rpm -ivh http://pkg.cloudflare.com/cloudflare-release-latest.el6.rpm
vi /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

CentOS7

sudo rpm --import https://pkg.cloudflare.com/pubkey.gpg
sudo rpm -e gpg-pubkey-8e5f9a5d-*
sudo rpm -ivh http://pkg.cloudflare.com/cloudflare-release-latest.el7.rpm
yum install railgun-stable -y
vi /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

Debian9

echo 'deb http://pkg.cloudflare.com/ stretch main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -
sudo apt-get update
apt-get install railgun-stable -y
nano /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

Debian8

echo 'deb http://pkg.cloudflare.com/ jessie main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -
sudo apt-get update
apt-get install railgun-stable -y
nano /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

Ubuntu 16.04

echo 'deb http://pkg.cloudflare.com/ xenial main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -
sudo apt-get update
apt-get install railgun-stable -y
nano /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

Ubuntu 14.04

echo 'deb http://pkg.cloudflare.com/ trusty main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -
sudo apt-get update
apt-get install railgun-stable -y
nano /etc/railgun/railgun.conf
#修改以下字段
#activation.token = 找云筏要来的token
#activation.railgun_host = 本服务器的IP
systemctl enable memcached
systemctl start memcached
systemctl enable railgun
systemctl start railgun
#完成安装

This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/775.html
Like (1)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(2)个小伙伴在吐槽
  1. 请问有没有windows版
    爵珞2020-06-28 13:30 Reply Windows 10 | Chrome 85.0.4173.0
    • Jason
      目前只有Linux版,Windows可以尝试用WSL2来部署
      Jason2020-07-02 17:54 Reply Mac OS X | Chrome 83.0.4103.116