x
 
Create New Page
 View Previous Changes    ( Last updated by siffring )

ExpressionEngine on Mosso

Rackspace Cloud (formerly known as MOSSO) is a high-end “cloud computing” host geared mostly toward designers/developers who also want to host some of their clients’ sites, but it also works well for sites with a need for scaling against sudden traffic spikes, for instance.

ExpressionEngine works perfectly well on MOSSO, but as with any environment, there are potential gotchas as well as some useful tips to be shared.

General ExpressionEngine Optimization

I do recommend paying careful attention to the tips on this wiki page; they’re applicable anywhere. In particular, turning off referrer tracking seems to make a big difference.

If you don’t need hit counting per template (and many people don’t), it’s useful to turn it off. (That’s an update query per page view, which can add up quickly!) Unfortunately, that currently requires modifying a core file, as per this thread. It’s not a scary modification, but it will have to be redone after upgrades.

Output Compression

As noted in this thread, make sure to turn off the “GZIP content” setting in Admin -> System Preferences -> Output and Debugging Preferences.

Output may or may not be gzipped by default at Mosso—reports differ as to whether everyone is gzipped or not. If you are not seeing gzipped output, use the following in your .htaccess file (you may delete whichever block does not apply, if you know which version of Apache you are running under.) (Note that » marks a continued line (broken for prettiness); you MUST remove the linebreak in your actual file.)

# THE FOLLOWING TWO BLOCKS ARE MUTUALLY EXCLUSIVE. IF YOU KNOW WHAT SERVER VERSION
# YOU ARE RUNNING ON, YOU SHOULD DELETE THE ONE THAT ISN'T NEEDED.

# GZIP FOR APACHE 1.3.x SERVERS
<IfModule mod_gzip.c>
    
mod_gzip_on yes
    mod_gzip_dechunk yes
    mod_gzip_item_include file \
.htm$
    
mod_gzip_item_include file \.html$
    
mod_gzip_item_include file \.php$
    
mod_gzip_item_include file \.txt$
    
mod_gzip_item_include mime ^text/.*
    
mod_gzip_item_include file \.js$
    
mod_gzip_item_include file \.css$
    
mod_gzip_item_include file \.rdf$
    
mod_gzip_item_include file \.xml$
    
mod_gzip_item_include file \.rss$
    
mod_gzip_item_include mime ^application/x-httpd-php
    mod_gzip_item_include mime 
^application/x-javascript
    mod_gzip_item_include mime 
^application/javascript
    mod_gzip_item_include mime 
^text/css$
    
mod_gzip_item_include mime ^text/plain$
    
mod_gzip_item_include mime ^text/xml$
</
IfModule>

# DEFLATE FOR APACHE 2.x SERVERS
<IfModule mod_deflate.c>
    
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml »
application
/x-javascript application/javascript application/xhtml+xml
    
<FilesMatch "\\.(js|css|html|htm|xml)$">
    
SetOutputFilter DEFLATE
    
</FilesMatch>
</
IfModule

Multiple Sites on One Installation (Either MSM or “Old Method”)

If you want to set up multiple sites running off the same installation of EE, you must add all of your domains under the same client (or all under yourself). This will ensure that they all run under the same FTP user, and they will all show up side-by-side in your FTP home directory.

From there, you can follow the instructions for the “old method” or for the Multiple Site Manager to get your separate sites up and running.

Add-Ons Needing Modification

I’ll be compiling a list, gradually, of any add-ons (plugins, modules, extensions, etc.) that I run into which need to be modified in order to run under MOSSO, along with the suggested modifications.

One issue is that the PHP environment variable $_SERVER[‘DOCUMENT_ROOT’] does not work properly in MOSSO’s environment due to the way they’ve got their “cloud” working. So add-ons that depend on it rather than on EE’s built-in $PREFS->site_url will fail.

The ImageSizer plugin is one that suffers from this problem. In order to fix it, find the following line (around line 157):

$img_rootstep = (isset($_SERVER['DOCUMENT_ROOT'])) ? $_SERVER['DOCUMENT_ROOT'»
@getenv('DOCUMENT_ROOT'); 

(Note that » marks a continued line, broken for display only.) Replace this line with the information on your actual server path (find it under Websites->Features in your MOSSO control panel). For example:

$img_rootstep '/mnt/target03/123456/123456/www.yourdomain.com/web/content'

Make sure to leave the trailing slash off!

Category:HowTo Category:Hosting

Category:EE1

Categories: