Running Umbraco on Rackspace Cloud Sites

Here at Trio, we are currently in the process of moving all of our websites from our local datacenter to Rackspace Cloud Sites. That means moving a few Umbraco installations into a medium trust environment. To make things more challenging, I made the decision to convert everything to MySql as well. I decided to use this blog as the guinea pig and I have to say, everything worked out really well.

So, I thought I would write this post as a reminder to myself of the process and to share my experience (and screw ups) with everyone. Here we go!

Upgrade

First, I went ahead and upgraded this blog to Umbraco 4.5.2. You can find an upgrade guide on our.umbraco.org.

MySql

To convert everything to MySql, I simply created a fresh Umbraco installation running MySql and installed a package (containing all of my content, templates, doc types, xslt, etc.) that I created from the original blog.

Here is where I screwed up.

To deploy my blog to Rackspace, I simply did a backup of my local MySql database and restored it to the server on Rackspace using MySql Administrator. I was left with an exception that told me that the table UMBRACODOMAINS did not exist. Of course it did exist and after some research I found a solution to the problem.

MySql has a configurable identifier called lower_case_table_names that has a different default value based on the OS that MySql resides on.

My local installation is on Windows XP, so the default value is 1. That means that all table names will be converted to lowercase and that name comparisons ARE NOT case sensitive.

That means when I installed Umbraco on my local server, all of my table names were converted to lowercase. However, queries from Umbraco use uppercase table names.  Again, this is not a probem on Windows becase comparisons are not case sensitive.

The problem is that Rackspace runs MySql on Linux where the default value is 0. That means that all table names are stored using the lettercase specified in the CREATE TABLE statement and comparisons ARE case sensitive.

Since I did a backup/restore from my local installation, all of the table names on the Rackspace server were in lowercase, thus causing the exception.

To solve the problem, I simply added the following under the [mysqld] section of C:\Program Files\MySQL\MySQL Server 5.1\my.ini:

[mysqld]
lower_case_table_names=0

Now, when I create local Umbraco installations running MySql, the table names will be left in uppercase making the databases interchangeable with MySql on Rackspace.

Web.config

Next, I set the following in web.config.

<add key="umbracoUseMediumTrust" value="true" />

Some instructions also tell you to uncomment the following line (as you would to force medium trust at the app level), but that will cause an exception on Rackspace because they do not allow app level overrides, so just leave it as is.

<!-- <trust level="Medium" originUrl=".*" />-->

Impersonation

Finally, you will need to add impersonation under the system.web section. This will enable Umbraco to read/write to the file system. You will need to impersonate the default FTP account that is created by Rackspace when you created the site.

If you are in the Dallas datacenter you will use the following:

<identity impersonate="true" userName="dfw\YOUR_FTP_USERNAME" password="YOUR_FTP_PASSWORD" />

If you are in the San Antonio datacenter you will use the following:

<identity impersonate="true" userName="sat\YOUR_FTP_USERNAME" password="YOUR_FTP_PASSWORD" />

Of course, you will also need to update umbracoDbDSN with the correct values for your database on Rackspace.

Drop File Extensions (optional)

Rackspace is already set up to run without file extensions, so you might as well go ahead and drop them.

<add key="umbracoUseDirectoryUrls" value="true" />

Be sure to update any rules you may have in /config/UrlRewriting.config as well.

Closing Thoughts

So far, my experience with Rackspace Cloud Sites has been great. Technical support (especially live chat) has been superb and the Control Panel is simple to use. I am incredibly grateful for the hard work and effort put in by Benjamin Howarth and the rest of the Umbraco team that enabled us to have Umbraco running in such an ideal environment.

Comments

  1. Gravatar of eran By eran on Saturday, October 23, 20101
     
    Thanks for the Great Article! very helpful.
    1. can i ask why you preferred to use mySql? because as far as i know you in rackspace sites you can choose between mysql/ms-sql without additional fee.
    2. is there are any disadvantage or issues when using mySql for umbraco? (rather than ms-sql).
    3. i know that there package is 10,000 compute cycles. can you tell me if its run out fast or its enough for few sites with average traffic?
    Thanks.
  2. Gravatar of Ricky Beard By Ricky Beard on Saturday, October 23, 20102
     
    You are very welcome. Here are some answers:

    1. MySql is free on Rackspace. You must pay for MSSQL in 200 MB chunks.
    2. Nothing beyond the difference in SQL syntax.
    3. I have about 8 sites running right now and my compute cycles are barely on the scale.

    Let me know how it goes for you.
  3. Gravatar of Rupert By Rupert on Tuesday, November 23, 20103
     
    Hi Ricky,

    Thanks for your post, very helpful - finding a decent host for Umbraco has been a pain! We have managed to install Umbraco and it's working fine except one rather large issue - caching.

    Due to cloud sites being clustered and load balanced (I'm not technical enough to fully understand this) we appear to have an issue with updates showing across the site irrespective of whichever server instance you end up being directed to. ie. sometime it will show sometimes it won't. This doesn't appear to be a problem in the backend as we can simply reload the nodes but is likely to upset clients if they make changes which don't show up. Have you experienced this?

    There appears to be some customisation you can do using one server for updates and instructing it to update all others but having spoken to rackspace this won't work on cloud sites as they can't give the DNS details of each server instance. The other solution appears to be to republish the entire site, as this prompts a refresh of the cache, but I worry that that isn't ideal for clients once their site become large and content heavy.

    Any pointers you or anyone else could give would be much appreciated.

    Cheers.
  4. Gravatar of Ricky Beard By Ricky Beard on Friday, December 03, 20104
     
    I actually have experienced this same issue very recently on a new site I am working on. Oddly, I have not had a problem with this blog at all.

    Of couse the problem, as you already said, is that Umbraco caches the umbraco.config file to speed up performance. That means changes to the cache on one cloud node will not be reflected on the rest of the cloud nodes.

    The only solution I have found for Rackspace is to set XmlCacheEnabled (and maybe ContinouslyUpdateXmlDiskCache) to false in the /config/umbracoSettings.config file.

    This will force Umbraco to read from the umbraco.config file directly for every request instead of using the cache. I cannot speak to the performance loss, but I would assume for a small to medium site that it shouldn't be too bad. File IO shold not be any slower than DB access for dynamic content.
  5. Gravatar of Mike Royle By Mike Royle on Tuesday, December 07, 20105
     
    Hi Ricky,

    Thanks for posting this, it was a real help to me, both as a timesaver and for reassurance.

    Cheers,
    Mike
  6. Gravatar of Benjamin Howarth By Benjamin Howarth on Tuesday, December 21, 20106
     
    Thanks for sharing Ricky - very useful! :-)
  7. Gravatar of Gibby Ola By Gibby Ola on Tuesday, December 28, 20107
     
    Hi Ricky,

    Thanks for this insightful info on rackspace. I am actually planning to do that now. One quick question, is ImageGen available in medium trust as well ?
    Thanks for your help
  8. Gravatar of Ricky Beard By Ricky Beard on Wednesday, December 29, 20108
     
    You're welcome Gibby.

    Douglas Robar, the man behind ImageGen, posted a couple of months ago on our.umbraco.com that medium trust support is slated for version 3.0. However, he seems to still be working on getting version 2.5 released.

    I would just check with him directly to get a timeframe. He is @drobar on twitter.
  9. Gravatar of Mike Royle By Mike Royle on Tuesday, February 08, 20119
     
    Hi Ricky,
    Have you managed to get Canvas Editing working on CloudSites?
  10. Gravatar of Ricky Beard By Ricky Beard on Thursday, February 10, 201110
     
    No Mike, I haven't. I have never really used the Canvas functionality as it has been hit and miss in my experience depending upon the CSS layout of the site. I have gotten some weird results in the past.

    If fact, I had never even tested it on Rackspace until I read your comment. I am getting the familiar, ugly, yellow permissions error. I assume you get the same.
  11. Gravatar of Mike Royle By Mike Royle on Wednesday, February 23, 201111
     
    Yes, same for me Ricky. It not a major problem for me but I'll let you know if I get anywhere with it.
  12. Gravatar of Hugh Abbott By Hugh Abbott on Friday, March 11, 201112
     
    Hey - brilliant - I didn't know you coud run Umbraco on MySQL.
    Have you had any experience with uploading packages onto Umbraco sites running on MySQL ... I mean do they all work perfectly ?

    Hugh
  13. Gravatar of Ricky Beard By Ricky Beard on Saturday, March 12, 201113
     
    I don't install a lot of packages, but I have not had any trouble with the few I have used.

    The author of the package is supposed to disclose if it will only work with certain versions of Umbaco or if it is limited to a particular database. However, there is no way to know for sure except to test it.
 

About Me

I am a Founder and Managing Partner of Trio Technologies and Trio Merchant Services in Abilene, Texas. I have a beautiful wife and two incredible sons.

Popular

Blogroll

Bookmarks