Fileconveyor on Rackspace with Drupal

Rackspace logo

Thank you to our guest author, Brian Degnan, PhD. for contributing his experience after a battle with Rackspace, Fileconveyor, Drupal, Linux, and inodes. :)

Fileconveyor on Rackspace

I recently was tasked with debugging a deployment issue with the CDN on Rackspace. If you use Drupal, Magento, Wordpress, etc on Rackspace and want a CDN, they will suggest to you to use Fileconveyor. Fileconveyor either works great or it does not work based on how the application writes files to the directory.

If you write a single file, we had no issues at all with Fileconveyor; however, we found that we had issue when applications wrote to a file that was embedded in a new directory structure.

The issue: Fileconveyor uses inode-notify and the "link" call to the file system would not give the whole inode chain, or as least not in Python2.6 as of Linux Kernel:

2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The symptom: files were not being written to the filesystem! Aack!

I still suggest that you try Fileconveyor as it works well with the Drupal CDN module; however, you must be mindful that certain modules might affect the behavior between the filesystem and Drupal.

Also, all servers leveraging fileconveyor must be set up the same for proper functionality.  In order to setup Fileconveyor the same way across all of the servers, we made a script: setup.fileconveyor.sh.

This script made a standard layout for all of the servers with the Fileconveyor code in /var/fileconveyor. /var/fileconveyor is also where all of the database files for Fileconveyor are stored. The setup.fileconveyor.sh script also copies fileconveyor.sh into /var/fileconveyor, where fileconveyor.sh has its modes changed so that it runs as apache.

setup.fileconveyor.sh

1. The subset of the script, setup.fileconveyor.sh, is explained below, that can be run as standalone commands.

mkdir -p /tmp/fileconveyor cd /tmp/fileconveyor pip install -e git+https://github.com/wimleers/fileconveyor@master#egg=fileconveyor

If you do not have pip installed, this will fail. Install pip.

2. Next we make the infrastructure for the Fileconveyor application. I assume the user for the web server is "apache".

mkdir -p /var/run/fileconveyor chown apache /var/run/fileconveyor chmod 700 /var/run/fileconveyor

3. Next, you make the location for the application.

mkdir -p /var/fileconveyor chmod 700 /var/fileconveyor mv /tmp/fileconveyor/src/fileconveyor/fileconveyor /var/fileconveyor chown -R apache /var/fileconveyor

4. Finally, you copy fileconveyor.sh into /var/fileconveyor, and set the modes that it runs as "apache".

chown apache:apache /var/fileconveyor/fileconveyor.sh chmod 4755 /var/fileconveyor/fileconveyor.sh