Setting up Railgun on cPanel

Using Railgun for faster load times and more efficient caching.

CP+RG

Nearly 70% of web content is cacheable (JS, CSS, & HTML). CloudFlare’s CDN leverages this by sync’ing to multiple datacenters worldwide.

They’ve taken it a step further with their RailGun Tech. RailGun maintains an active TLS/TCP link at which is able to cache up to 99.6% of the data from the origin server to CloudFlare.

Website structure changes are typically infrequent (body, tags, scripts, JSON API responses). When dynamic content changes, markup code is typically only slightly affected.

The “listener” module on the origin server detects these changes and syncs to the “sender” module on the CloudFlare network.

Installing RailGun on any RPM-based x64 server is simple.

Add the server’s IP(s) to your RailGuns in the CloudFlare Partner Panel

RailgunPartnerPortal

Prep the server by opening firewall TCP/2408 to CloudFlare’s Network IPs:

IPv4

103.21.244.0/22

103.22.200.0/22

103.31.4.0/22

104.16.0.0/12

108.162.192.0/18

131.0.72.0/22

141.101.64.0/18

162.158.0.0/15

172.64.0.0/13

173.245.48.0/20

188.114.96.0/20

190.93.240.0/20

197.234.240.0/22

198.41.128.0/17

199.27.128.0/21

IPv6

2400:cb00::/32

2405:8100::/32

2405:b500::/32

2606:4700::/32

2803:f800::/32

2c0f:f248::/32

2a06:98c0::/29

Add the following to httpd.conf

$ CloudFlareRemoteIPTrustedProxy 127.0.0.1

This adds your RailGun instance to the trusted proxy list.

Install RailGun with yum:

$ yum install railgun-stable

Activating RailGuns in cPanel:

Click the CloudFlare plugin in cPanel.cloudflare plugin

Select “Performance” from the top menu.

Performance

Scroll to the site you’d like to enable RailGun and click “Settings” to the left of the domain name you select.

Next to the RailGun option, press the “Off” button to toggle it to “On”

railgun

That’s it.

Any domain that is setup on CloudFlare’s DNS and has it’s IP listed in the partner panel can utilize Railgun via cPanel.