Justin Tyler Wiley

Work, Play, Thoughts

September 19, 2011 at 6:23pm
home
Share & Bookmark

XSendfile: critical for Rails 3.1 on Apache

After several hours troubleshooting my production Rails environment, I finally found out why images were not being served properly after an upgrade to 3.1: no XSendfile module.  Rails 3.1/Sprockets apparently relies heavily on Apache’s XSendfile to serve assets, and without the module installed and configured, images will silently fail and browsers will display a missing image.

To enable under Ubuntu:

  1. sudo apt-get install libapache2-mod-xsendfile
  2. Add XSendFile On to your Apache vhost file
  3. Add XSendFileAllowAbove on under the directory definition for your public folder

More details here.

You're settling for good when there's awesome.  Upgrade to Firefox 3.6!