Cloudflare

From Arch Hosting Wiki
Jump to navigation Jump to search

We recommend all Web Hosting accounts utilize Cloudflare. Arch Hosting is a Cloudflare Optimized Partner, and as such you can take advantage of bonuses such as Cloudflare Railgun™ for free.

Signing up at Cloudflare

The first step is to go to https://dash.cloudflare.com/sign-up and create a Cloudflare account. You will then be prompted to enter your domain name, like such:

KlIr8GX.png

You can use the $0/mo free plan. Purchasing a Pro, Business, or Enterprise plan is optional and not required for Railgun™.

Cloudflare should automatically grab your DNS records from Arch Hosting and input them in. If not, read the next section.

Manual DNS Configuration

In the event that no DNS records are grabbed automatically by Cloudflare, manual setup will be required. If your Cloudflare setup did grab your DNS records, you can skip to the next section.


You will need a bare minimum of two records for your website to load. Please visit the server hostname wiki page for assistance on identifying your server IP address and hostname.

Type: A

Name: @

Value: Your server's IP address

Type: A

Name: www

Value: Your server's IP address


If you wish to receive mail, create the following DNS record:

Type: MX

Name: @

Value: Your server's hostname


If you wish to improve email deliverability, create the following DNS record:

Type: TXT

Name: @

Value: v=spf1 +a +mx +ip4:SERVERIP ~all


If you want to be able to use "mail.yourdomain.com" as the connecting server name with your email client, create the following DNS record:

Type: A

Name: mail

Value: Your server's IP address

Important: You should not enable Cloudflare on the DNS record. Ensure that the orange cloud was clicked to turn grey, which indicates that Cloudflare is not enabled on this DNS record.


If you want to be able to use "ftp.yourdomain.com" as the connecting server name with your FTP client, create the following DNS record:

Type: A

Name: ftp

Value: Your server's IP address

Important: You should not enable Cloudflare on the DNS record. Ensure that the orange cloud was clicked to turn grey, which indicates that Cloudflare is not enabled on this DNS record.


If you want to be able to use "cpanel.yourdomain.com" as a URL to access your cPanel, create the following DNS record:

Type: A Name: cpanel Value: Your server's IP address

Important: You should not enable Cloudflare on the DNS record. Ensure that the orange cloud was clicked to turn grey, which indicates that Cloudflare is not enabled on this DNS record.

Adding Custom Subdomains

If you have created any subdomains in your cPanel, you will need to create them in Cloudflare now. Usually, Cloudflare can not automatically grab these custom records and as such you will want to manually add them. Please visit the server hostname wiki page for assistance on identifying your server IP address.

Create a record for each of the subdomains like follows:

Type: A

Name: Subdomain name

Value: Your server's IP address

Where it says subdomain name, you should input just the subdomain part. For example, if you have a subdomain called "forum.example.com" you should only enter "forum" into the DNS record's name.

If you ever create any new subdomains in the future, please remember to create a DNS record for them at Cloudflare or they will not load.

Updating Nameservers

Once Cloudflare has your DNS records, click Continue. You will then be provided the nameservers to update your domain for. You can perform this via the control panel of your domain registrar.

If your domain is registered through us, you can see this guide: Nameservers#How_do_I_update_my_nameservers_for_a_domain_registered_at_Arch_Hosting.3F

Once you've updated your nameservers, click continue. Please note that nameserver changes are not always instant and it can take up to a few hours before they are processed. You can click the "Re-check now" button on the Cloudflare dashboard for it to check if your nameservers have been updated.

One thing to note now is that in the future, if you ever need to make any DNS changes they should all be done via Cloudflare. The "Zone Editor" in your cPanel will do nothing when your nameservers are pointed to Cloudflare's.

Enabling Railgun™

Once Cloudflare detects that your nameservers have been updated, you can enable Railgun™. To do this, visit the "Speed" button in your Cloudflare dashboard and then scroll down to the Railgun™ section. You should enable the Railgun for the server that you are on. Check the server hostname wiki page if you are unsure which server you are on.

Once you've toggled Railgun on, you can click the "Test" button to check if it is successful.

FlsAmCN.png

Rocket Loader™

Under the "Speed" icon in your Cloudflare dashboard, there is an option to enable Rocket Loader to "improve the paint time for pages that include JavaScript". We usually see enabling this break a lot of websites, so if you decide that you wish to enable it we would recommend heavily testing your website afterwards to ensure all is well. You can still benefit from Cloudflare's performance boosts with Rocket Loader disabled.

Auto Minify

Under the "Speed" icon in your Cloudflare dashboard, there is an option to auto minify JavaScript, CSS, and HTML. After enabling these options, we would recommend reviewing your website to ensure that nothing broke. While rare, it is possible that extremely complex websites with a lot of scripts can break with minification.

Development Mode

If you're making changes to your website's CSS or JavaScript - such as modifying a theme - you may wish to enable Development Mode. This can be done by visiting the "Caching" icon in Cloudflare's dashboard and toggling on development mode. Development mode will be automatically toggled off after three hours. Development mode disables a majority of Cloudflare's caching, which ensures that you are fetching the latest version of your website. At the same time, we would recommend clicking "Purge Everything" at the top of the Caching page in Cloudflare, and also clearing your browser cache.

cPanel Connection

You can connect your Cloudflare account to your cPanel. To do this, login to your cPanel and visit the "Cloudflare" icon. Click "Sign in here" and enter your Cloudflare login credentials. You will now be able to manage some items, toggle DNS records, and view analytics directly from your cPanel.

QlD1ust.png