Category: RackSpace

Downloading RackSpace CloudFiles Container with Swiftly

Swiftly is a handy utility for managed RackSpace CloudFiles containers from the Linux command line. You can easily download an entire container with a simple command line. Here’s the project page on Github: https://github.com/gholt/swiftly And here’s the documentation: http://gholt.github.io/swiftly/ Installation through a package manager is as follows: Ubuntu Update the apt-get database.

Install the Python installer, pip, using apt-get.

Install Swiftly using pip.

CentOS Install the Python installer, pip, using yum.

Install swiftly using pip.

After installation you can start transferring files. Here’s an example:

The entire [container] will be downloaded to [destfolder]. Check the Swiftly documentation for a wide range of options. You can select with precision which files to download.

Read More »

Fixing CORS Issues With RackSpace Cloud Files CDN, W3 Total Cache and WordPress

A resource makes a cross-origin HTTP request when it requests a resource from a different domain than the one from which it was served.  For example, an HTML page served from http://acme.com makes an <img> src request for http://mydomain.com/image.jpg. Many pages on the web today load resources like CSS stylesheets, images and scripts from separate domains. For security reasons, browsers restrict cross-origin HTTP requests initiated from within scripts. For example, XMLHttpRequest follows the same-origin policy. So, a web application using XMLHttpRequest could only make HTTP requests to its own domain. The solution to allowing cross-origin requets is the new Cross-Origin Resource Sharing (CORS) mechanism. If http://acme.com makes a scripted request for http://mydomain.com/image.jpg then the server hosting mydomain.com must include an “Access-Control-Allow-Origin” header. This header signals to the browser that it is ok to use the resource. The value of the header can be “*” which allows requests from all domains or it can

Read More »

Content Updates With W3 Total Cache & RackSpace Cloud Files

We get frequent questions from WordPress clients with W3 Total Cache (W3TC) and RackSpace Cloud Files (RCF) content distribution network (CDN) about how to make changes to the website visible. First some general notes: Content changes or updates to pages or posts do not involve the CDN so no special actions are required. W3TC will automatically flush old pages and post revisions from it’s caches. Media files uploaded through WordPress admin will be automatically uploaded to the CDN and can be immediately used in post or pages with no additional action. Files that are changed via FTP will required additional action. This included media files, CSS and Javascript as discussed below. As an example, let’s assume that you’ve modified you themes primary stylesheet at: wp-content/themes/mytheme/style.css You made the modification by downloading the file, editing on your workstation and then uploading via SFTP back to the server. In this case W3TC

Read More »

Fonts & RackSpace Cloud Files

If you try to serve fonts from RackSpace Cloud Files or other CDN then you may run into problems with browsers refusing to load the fonts. Here’s an example error: Font from origin ‘http://xxxxx.xxx.rackcdn.com’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://www.acme.com’ is therefore not allowed access. The problem is your browser doesn’t consider it secure to load the font from a different domain then the web page itself was loaded from. The solution is CORS or Cross-Origin Resource Sharing as described here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS When RackSpace Cloud  Files serves the font file, it needs to set a header like:

or more specifically:

This informs your browser that it is save to include this resource in the indicated alternate origin. RackSpace Cloud Files provide a means to change the headers on individual files. Here’s the technical

Read More »

Clone RackSpace Cloud Files Container With TurboLift

turbolift is an absolutely brilliant utility for manipulating RackSpace Cloud Files.  With turbolift you can do things like: Upload a directory, (recursively) Upload a single file Upload a local directory (recursively) and sync it with a Cloud Files Container Download a Container to a local directory Download changed objects from a Container to a local directory Compresses a Local Directory, then uploads it List all Containers List all Objects in a Container Delete an Object in a Container Delete an entire Container Clone one Container in one region to another Container in the same or Different Region. Set Custom headers on Objects/Containers Wow! So in this article I’m going to demonstrate how to clone a container. Here’s the download link for turbolift: https://github.com/cloudnull/turbolift On CentOS 6.5 the install is easy:

Now lets assume that we have a container on RackSpace Cloud Files name “devimages” and we want to copy

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.