Crucial Web Hosting

Crucial Web Hosting is another of the new bread of modern web hosting platforms that focuses on both speed and support. The use of SSD drives and Litespeed web servers with the latest Intel XEON processors ensures that Grav performs fantastically. Crucial also now provides PHP all the way up to the latest PHP 7.0 releases.

In this guide, we will cover the essentials for configuring the Tier-1 Split-Shared hosting package to work optimally with Grav.

Picking your Hosting Plan

Crucial Web Hosting has two primary options when it comes to hosting: Spit-Shared and Split-Dedicated hosting. According to Crucial, these cloud-based options are superior to traditional hosting setups as they provide better isolation and performance.

Split-Shared hosting ranges from $10/month to $100/month depending on memory and SSD space. Split Dedicated ranges from $150/month to $650/month depending on number of cores, memory, SSD space and bandwidth. We'll just be using the baseline $10/moth option that comes with 256MB of memory and 10GB of SSD space.

Enabling SSH

First, you will have to open the Toggle SSH Access option in the Security section of cPanel. On this SSH Access page, you should click the Enable SSH Access button.

Then from the Security Section again, click the Manage SSH Keys option.

There are two options at this point. Generate a New Key, or Import Key. It's simpler to create your public/private key pair locally on your computer and then just import the DSA Public Key.

Windows users will first need to install Cygwin to provide many useful GNU and open source tools that are available on Mac and Linux platforms. When prompted to choose packages, ensure you check the SSH option. After installation, launch the Cygwin Terminal

Fire up a terminal window and type:

$ ssh-keygen -t dsa

This key generation script will prompt you to fill in some values, or you can just hit [return] to accept the default values. This will create an id_dsa (private key), and an id_dsa.pub (public key) in a folder called .ssh/ in your home directory. It is important to ensure you NEVER give out your private key, nor upload it anywhere, only your public key.

Once generate you can paste the contents of your id_dsa.pub public key into the Public Key field in the Import SSH key section of the SSH Access page:

After uploading, you should see the key listed at the Public Keys section of the Manage SSH Keys page. You then need to click Manage to ensure the key is authorized:

This means you are ready to test ssh'ing to your server.

$ ssh crucial_username@crucial_servername

Obviously, you will need to put in your Crucial-provided username for crucial_username, and the crucial-provided servername for crucial_servername.

Configuring PHP

Currently Crucial Web Hosting defaults to PHP 5.3, which is not up to the minimum requirements for Grav. Luckily Crucial supports PHP all the way up to the latest PHP 7.0 so we change the PHP version to something more current.

To do this, we have to add a special handler call in the .htaccess file in the web root. So create the ~/www/.htaccess file and put the following:

AddHandler application/x-httpd-php70 .php

Save the file. To test that you have the correct version of PHP, you can create a temporary file: ~/www/info.php and put this in the contents:

<?php phpinfo();

Save the file and point your browser to this info.php file on your site, and you should be greeted with PHP information reflecting the version you selected earlier:

If you are installing Grav at the root of your hosting account, you will need to add the AddHandler method to the top of the .htaccess file that is provided with Grav

You can choose another version of php to run Grav under using such as PHP 5.6 with x-httpd-php56 for example

Setup CLI PHP

At the time of this writing, Crucial's default PHP version is 5.3. Because Grav requires PHP 5.5+, we need to ensure that Grav is using a newer version of PHP on the command line (CLI). To accomplish this, you should use SSH to access your server and create a new symbolic link to a newer PHP version in your user's bin/ folder: