The Ultimate Server: Mercury + Aegir

server

The Ultimate Server: Mercury + Aegir

We were in need of a new server that could quickly spin up sites for development but also was tuned for Drupal. Having followed and played with the different technologies that exist out there for hosting Drupal (Aegir, Mercury), I decided to try and create my "dream" server that was easily fully optimized but also ran Aegir for ease of site creation and maintenance. It took me a while to get it right and it seems I always run into odd errors for a while. I'll try and remember everything I learned along the way. The first step is to spin up an instance of Ubuntu 10.4 somewhere. We use Rackspace right now but there is some great support for Amazon out there as well and there are some reasons why Amazon might be a better solution for something like this, specifically being able to increase the amount of RAM separate from the main machine. Next I followed the steps from http://groups.drupal.org/node/70268 which show how to install Mercury (1.1 Beta) on a fresh install of Ubuntu 10.4. Be sure to install the 3.3 version of Drush as any newer versions will cause problems with Aegir later (as I found out the hard way). Also, while it is fine to run through all the steps, because we are installing aegir, it is not entirely necessary to do some of the steps about setting up the /var/www directory. To install Aegir on Mercury I used the instructions at http://community.aegirproject.org/node/389 and had trouble for a while till I started using Drush-3.3. Many of the instructions are overlap but that is fine. Once aegir was installed and running I needed to do a few more tweaks to the settings to make everything work correctly. I could create a site but it was automatically creating the sites for *:80. Since Mercury has Varnish running on *:80 you couldn't really connect to them and should instead use the *:8080 port in apache. To fix this edit the /var/aegir/.drush/server_master.alias.drushrc.php and change http_port to 8080. Then reverify all sites and they should be using 8080. Next we need to tell all the sites in aegir to use the reverse proxy for varnish. While we could edit the settings.php files for each of the sites but this would be a hassle. Luckily Aegir includes a global.inc file that has global settings for the sites that are automatically included. So add # Varnish reverse proxy on localhost $conf['reverse_proxy'] = TRUE; $conf['reverse_proxy_addresses'] = array('127.0.0.1', 'YOUR_IP_HERE'); to the global.inc file and all sites will begin using it. My server didn't have very much RAM so it didn't make a lot of sense to set up memcached as the caching mechanism. I found some interesting information on how to do this though. In the same global.inc file you can add: # Memcached configuration - uncomment to use Memcached instead of Cacherouter: $conf = array( 'memcache_key_prefix' => $_SERVER['HTTP_HOST'], 'cache_inc' => './sites/all/modules/aa_pressflow/memcache/memcache.db.inc', 'memcache_servers' => array( '127.0.0.1:11211' => 'default', '127.0.0.1:11212' => 'menu', '127.0.0.1:11213' => 'filter', '127.0.0.1:11214' => 'form', '127.0.0.1:11215' => 'block', '127.0.0.1:11216' => 'update', '127.0.0.1:11217' => 'views', '127.0.0.1:11218' => 'content', '127.0.0.1:11219' => 'apachesolr', ), 'memcache_bins' => array( 'cache' => 'default', 'cache_menu' => 'menu', 'cache_filter' => 'filter', 'cache_form' => 'form', 'cache_block' => 'block', 'cache_update' => 'update', 'cache_views' => 'views', 'cache_views_data' => 'views', 'cache_content' => 'content', 'cache_apachesolr' => 'apachesolr', ), ); Finally, in order to take advantage of varnish, memcache and general speediness, be sure to use the pressflow distribution NOT the core drupal for all of your Aegir platforms. Anyone have any more tips for how to set up a server like this? More information: http://groups.drupal.org/mercury http://community.aegirproject.org/http://groups.drupal.org/node/55393 http://groups.drupal.org/node/55033 http://groups.drupal.org/node/35984 http://groups.drupal.org/node/70268

Related Posts

How to Allow Password SSH Authentication for Pantheon/Mercury Servers or other Amazon Images

Dustin Currie
Read more

The Ultimate Drupal Guide, Part 1: Where to get Direct Help

Sean Keeley
Read more

Create a high performance Drupal server for just $30 a month

Randall Knutson
Read more

The Ultimate Drupal Guide, Part 2: Video

Sean Keeley
Read more

Installing Drupal for Beginners Tutorial

Tom McCracken
Read more

Redirect all requests to a canonical domain

Dustin Currie
Read more