drupal

Managing News - Revolutionary—not Evolutionary—Step for Drupal

I noticed a post from the excellent folks over at Development Seed in the drupal.org Planet feed on a new Drupal installation profile they've been working on called Managing News. Having tried (and loved) their Drupal-based installation of Open Atrium (a great package for quick Intranets), I had pretty high expectations.

Those expectations were pretty much blown out of the water; this install profile basically sets up a Drupal site (with all the Drupal bells and whistles) that is focused on one thing, and does it well: news aggregation via feeds (Atom, RSS).

Catholic News Live.com - Catholic News Aggregator

I decided to quickly build out an aggregation site, Catholic News Live. The site took about 4 hours to set up, and it's already relatively customized to my needs. One thing I still don't know about is whether Drupal's cron will be able to handle the site after a few months and a few hundred more feeds... but we'll see!

Moving Your Drupal 'files' Folder - Dev to Live Sites

When I was rebuilding www.jeffgeerling.com in Drupal, I decided to use the testing domain new.jeffgeerling.com. This presented me with a challenge, once I started working a bit more on the site, as I set up imagecache, the file system, the favicon, the logo, internal images in posts, images inserted into blocks, etc., into my /sites/new.jeffgeerling.com/files directory.

If I simply renamed the directory to 'jeffgeerling.com' and went live, I'd end up with tons of 404 errors. Currently, there's no easy way to switch the location of your files directory in Drupal. Lacking an easy method, it's time to get your hands dirty with a little SQL (I entered the following commands via phpMyAdmin, since my host doesn't yet allow SSH access):

Moved to Drupal. Hello Drupal!

As of today (October 5, 2009), I have moved all the content off the old Lifeisaprayer.com into a new Drupal-based site, in order that I might not have to do so much manual labor in maintaining and updating the site.

This has been a long time coming, as I had the idea to move to a CMS (it was a heat between Drupal (for extensibility) vs. WordPress (for it's ease of use for blogging). But as I didn't know exactly what I wanted this site to become (is it about articles? the blog? photo galleries? what???), I figured Drupal would be the best choice, as I can have a lot more freedom in building out new functionality now. Wordpress is a little limiting if you want to really stretch your site into different directions.

I'm working on the site's theme right now, and probably will be tweaking it over the next few weeks. Please let me know if you have any problems or have suggestions for improvement!

Adding Module Stylesheets using drupal_add_css()

A couple days ago, when building a quick site with limited functionality (basically a pretty front end to a database website), I ran into a hiccup with my custom module/theme for the site, which caused me to scratch my head for a few minutes.

In my custom module (called 'idcards'), I added a stylesheet for a couple forms on the site using the drupal_add_css() function:

/**
 * Implementation of drupal_add_css()
 */
drupal_add_css(drupal_get_path('module', 'idcards') .'/idcards.css');

Later on in the development, I added a custom theme (based off a Zen subtheme I use for many smaller sites), and in that custom theme's .info file, I added a stylesheet named idcards.css.

When I cleared all the caches, I noticed the custom form styling (added by the module's idcards.css file) was missing, and on further investigation, I found that the module's idcards.css file was not being added to the pages!

The Storm Before the Calm - Help Drupal Designers!

With less than two weeks remaining until Drupal 7's 'code freeze,' when new features and major patches will no longer be added to Drupal 7 (instead, everyone will work to optimize and clean up all the approved patches/features for an official Drupal 7 release), it's crunch time for those wishing to make Drupal a dream for designers and themers.

Initially, I had a lot of time to help along with a bunch of other great Drupal users (new and veteran alike) to help nail down a better set of core template files (.tpl.php files), along with some CSS definitions, in order to allow people to code new (and hopefully better) themes straight from Drupal core, using nothing but CSS and a .info file. (See the Stark theme (built into Drupal 7) for an example of how simple a Drupal theme can truly be!).

We've made it through:

Running Apache Benchmarks: Drupal/Joomla core vs. Static Page Cache

I just discovered (after asking about it in the #drupal IRC channel) the wonderful little program ab, included in an Apache installation. This little nugget does one thing, and does it well: It beats the heck out of your server, then tells you how your server did in terms of page serving. I tested a few different configurations on a dedicated, 4-core, 4 GB RAM server from SoftLayer, and used the following two commands:

1. Download the specified URL 1,000 times, with KeepAlive turned off (each request gets a new http connection):

ab -n 1000 -c 5 http://ip.address.of.site/path-to-page.php

2. Downlaod the specified URL 1,000 times, with KeepAlive turned on (thus allowing the connection to be maintained for as many http downloads as you have set in your httpd.conf file):

ab -n 1000 -kc 5 http://ip.address.of.site/path-to-page.php

I ran these tests a few different ways, and here are the results of the tests I ran with KeepAlive on, with the number of pages per second ab reported listed after the method:

  • Drupal - normal page caching turned on, css/js aggregation, 55kb page – 12.5 pages/sec
  • Joomla - no page caching (disabled due to buggy 1.x caching), 65kb page – 8.2 pages/sec
  • Drupal - boost module enabled, serving up the boost-cached file – 3,250 pages/sec
  • Joomla - custom page caching system enabled, serving static html file – 2,600 pages/sec

Speed boost due to caching: ~250x faster!

Getting OSC's Drupal Install Optimized on Slicehost

Initially, when thinking about finally taking the plunge and purchasing a slice or two from Slicehost, I thought, "wow, this is going to be incredibly fast and awesome, compared to my Host Gator account!"

Slicehost + Drupal

But, after setting everything up and putting Open Source Catholic live on the fresh slice, running free -m, and looking at the results, reality set in: 256 MB of RAM is not much to work with if you're running a Drupal site on a LAMP stack! Drupal usually consumes 15-40 MB of RAM per page view for a logged-in user, and if you have a site with 10 or so logged in users at any moment... well, bad things can happen.

For anonymous users, using Boost will help your site fly no matter the amount of RAM you have. But even so, a bunch of requests to uncached pages will cause your site to load a heck of a lot slower, and will fill up your RAM faster than a fire hose fills up an 8 oz. glass!

Using default Apache, MySQL and PHP settings, free -m showed a full 250 MB of RAM used, along with 400-500 swap space used (swap should be kept to a minimum—if you have a lot of swap usage, that means the hard drive is being used instead of RAM, and the hard drive is inherently many times slower!). After performing a few quick modifications to Apache and MySQL, I was able to get this number down to 140 MB RAM / 40-60 MB swap, on average.

I modified the server configuration in two different places: Apache's httpd.conf, and MySQL's my.cnf:

From OSC: Caching a Page; Saving a Server

I posted a story over on Open Source Catholic today concerning page caching and its importance for saving a server under a heavy load (read: the slashdot effect). You can save a lot of resources on your server by not only using built-in page caching on your favorite CMS, but also exploring further options (for Drupal, there's Boost (read our case study on Boost); for WordPress, there's WP Super Cache). From OSC:

A couple months ago, the Archdiocese of Saint Louis announced that a new Archbishop had been chosen (then-Archbishop-elect Robert J. Carlson). For the announcement, the Archdiocese streamed the press conference online, then posted pictures on the St. Louis Review website of the day's events (updated every hour or two).

Open Atrium for Drupal - One Word Review

In one word: Awesome.

This Drupal distribution truly displays the beauty and power of Drupal—a dedicated team over at Development Seed spent a lot of time making a great Intranet-in-a-box solution built on top of Drupal, and even though it's a simple set of modules and an installation profile, you'd have to do a little digging to tell if an Open Atrium site even runs on Drupal!

Open Atrium Example Site

I've just been tinkering with it for a local nonprofit I help with, and I see a lot of potential. In less than 20 minutes (from the download of the tgz file), I had two groups, eight users, and a calendar/wiki/blog system running for everyone. It's drop-dead simple! If you're tasked with building an internal communications site, or a full-fledged Intranet, this is probably one of the easiest/best (and most free) solutions out there. Check it out!