Does anyone have correct installation instructions for mod_cloudflare on Ubuntu 14.04?

December 4, 2015 1.8k views
Apache One-Click Install Apps Ubuntu

I can't believe they haven't' updated these but they don't work on 14.04 at all. I know there is a manual install option but that is a real pain in the ass and requires installing all kinds of stuff. Isn't there an easy way with apt-get?

root@www:/root# dpkg-reconfigure unattended-upgrades

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version
root@www:/home/manuel# dpkg -i modcloudflare-XXXXX.latest.deb
dpkg: error processing archive mod
cloudflare-XXXXX.latest.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:

2 Answers

Maybe this: ?

However the error you're getting above is because you're supposed to replace XXXXX by the name of the file. Hence "No such file or directory". However it doesn`t look like they have 14.04 packages available.

  • How would I ever know what to replace it with? They don't say.

    Looking at the instructions at but they seem incomplete:

    Add the repository (replace <RELEASE> with the Ubuntu release name):
    $ echo 'deb <RELEASE> main' |
    sudo tee /etc/apt/sources.list.d/cloudflare-main.list

    For example:
    $ echo 'deb vivid main' |
    sudo tee /etc/apt/sources.list.d/cloudflare-main.list

    Import GPG key:
    $ curl -C - | sudo apt-key add -

    Update apt cache:
    $ sudo apt-get update
    Supported Versions

    Vivid (15.04)
    Utopic (14.10)
    Trusty (14.04)
    Precise (12.04)

    Doing sudo apt-get update updates my sources but it doesn't actually install the thing does it? How do I install it?

    Also of note although they list all the supported versions with capital letters Vivid, Utopic, Trusty, Precise they must be inserted in the command with a lowercase like "trusty". Really stupid that they don't list them for cut and paste.

    Still can't figure out how to install it though.

    • They do tell you you're supposed to use the name of the file you just downloaded. Maybe you never downloaded the package and expected "dpkg" to do it? That would explain the misunderstanding. I've never installed the module myself, if I were to do it I'd use the manual instructions. I was just pointing out that the cloudflare repository may contain the software you're looking for in case it could help.

      My advice would be to try the manual instructions.

      • Where do you even download the file? How do you know which one to download? Unless I'm missing it this info isn't there at all.

        With the second set of instructions ( ) I think I found the final command they so stupidly left out to complete the process:

        apt-get install libapache2-mod-cloudflare

        That seems to work. Just wondering... do I not need the "railgun specific" stuff? "not enabling Railgun-specific repository"

        Configuration file '/etc/apache2/mods-available/cloudflare.load'
        ==> File on system created by you or by a script.
        ==> File also in package provided by package maintainer.
        What would you like to do about it ? Your options are:
        Y or I : install the package maintainer's version
        N or O : keep your currently-installed version
        D : show the differences between the versions
        Z : start a shell to examine the situation
        The default action is to keep your current version.
        *** cloudflare.load (Y/I/N/O/D/Z) [default=N] ? y
        Installing new version of config file /etc/apache2/mods-available/cloudflare.load ...
        Enabling config file cloudflare.conf.
        To activate the new configuration, you need to run:
        service apache2 restart
        Main repository is already installed: deb trusty main
        Not enabling Railgun-specific repository


        • They didn't "stupidly leave out" anything, the page I gave you is for CloudFlare's repository, not the specific CloudFlare package you want to install.

          To download the files, you would have clicked the buttons with one of the names of the distributions, and transferred that package to your server, or used a more direct way. However I now understand that it wasn't downloaded prior to you running the output you gave in your original question. There goes that misunderstanding. Also as I mentioned the distribution you're using isn't directly linked on that page, had you downloaded any package it would've been for the wrong version.

          I do not know, do you need the railgun stuff? If you do, then we can maybe find out what repository to use to have it. Otherwise, you're probably fine.

          EDIT: looks like this is what railgun is:
          EDIT2: Railgun is available for customers with a CloudFlare Business or Enterprise plan or customers hosted with an Optimized Hosting Partner.

          Are you one of those?

          • Well let's see... Since their main install instruction page leaves out anything newer than Ubuntu 12.x and neither page tells you where to find the file to download or the package to install, where would one be expected to find that information? I've been searching for hours with no luck. It would make sense to put complete install instructions in one place.

            I see that it would have been the wrong version that's why I didn't download those files.

            I guess i don't need the railgun stuff - all just saw it's only for the business plans.

            After all this it doesn't even work though.

            All they needed to do is say for 14.04 run "apt-get install libapache2-mod-cloudflare"

            Unless you think this didn't correctly install? It sure looks like it did.

          • I wasn't defending their documentation in general (I have no idea really), just the packages page in particular. It is possible also that they expect people to use the manual instructions or the automated installer.

            It does look like it installed correctly from the repository, but of course you'd want to confirm that by configuring it if needed and testing the result.

Here it is:

Supported versions:
vivid (15.04)
utopic (14.10)
trusty (14.04)
precise (12.04)

Add the repository (replace <RELEASE> with the Ubuntu release name):
$ echo 'deb <RELEASE> main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list

For example:
$ echo 'deb trusty main' |
sudo tee /etc/apt/sources.list.d/cloudflare-main.list

Import GPG key:
$ curl -C - | sudo apt-key add -

Update apt cache:
$ sudo apt-get update
Supported Versions

Install package:
$ sudo apt-get install libapache2-mod-cloudflare

Thank you gp+digitalocean

Have another answer? Share your knowledge.