Why Lighty instead of Apache?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Want to know why some folks are choosing to use Lighttpd (Lighty) instead of Apache for hosting their Drupal installation? Here's a brief list of considerations in which Lighty excels over Apache.

Easier configuration

Easier configuration might not be the first thing people look for when considering Apache alternatives, but it ought to be a major consideration. Apache's configuration file syntax is disgustingly ugly and complex compared to that of Lighty. Here's a basic introduction for a to Lighty's configuration file syntax - it's kind of like a simple programming language itself, and makes it easy to only set certain configuration parameters if certain conditions are met.

If you ever run into a problem which isn't solved by Lighty's standard config file syntax or built-in modules, you can powerfully extend its standard configuration capabilities by using the mod_magnet module, which allows you to tweak configuration settings by running scripts written in a lightweight functional scripting language called Lua. You may cringe at the thought of learning yet another scripting language, but if you're already familiar with PHP and/or JavaScript, you can probably pick up the basics of Lua in under an hour. As an example, the Ultimate Lua Script for Drupal handles path rewriting and "www." addition/removal in much the same way Drupal's standard .htaccess file does.

Faster, lighter footprint

Generally speaking, Lighty executes HTTP requests faster and uses less RAM than Apache. We say "generally speaking" because it's probably possible to configure Apache so that it's faster and lighter than Lighty, and it's probably possible to configure Lighty so that it's slower and more bloated than Apache. But out-of-the-box, and given no bizarre configuration modifications, you're pretty much assured that you'll see better performance with Lighty than with Apache.

"But what about the memory leak?" you say… Do enough research around the web about Lighty, and you're bound to come across mention of a show-stopping memory leak that Lighty has. This leak has long since been fixed and should no longer be a factor in making your choice.

Why choose Apache over Lighttpd?

Though Lighty is often considered a "lightweight" server due to its lighter footprint, in truth it's a full-featured web server, and ought to be able to do pretty much anything you are able to do in Apache. That being said, you (or your clients) may require or depend on the behavior of particular or unusual Apache modules which Lighty just can't match - if this may be the case, you should definitely do your research before committing to a switch.

It should also be noted that Lighty has no analog to Apache's .htaccess system in terms of searching hosted directories for configuration files to override its configuration for files which are hosted from there. There are ways around it, but generally speaking, Lighty was designed to just have one central configuration file (plus whatever configuration files or Lua scripts are included from that configuration file). If you or your clients rely on a concept like .htaccess files, Lighty is not for you.

Lighty integrates with PHP and other scripting languages (it's quite popular in the Ruby on Rails community) via FastCGI. It can also use Simple CGI; however, documentation for SCGI support is very sparse compared to FastCGI. If you're a SCGI fanboy, you may find Lighty lacking. (Lighty can use standard CGI as well, if you're old school.)

But what about Nginx/Abyss/other web server alternatives?

Lighty is great, but while it can probably serve as a perfectly functional Apache replacement for 90% of web servers out there, it won't be for everyone. But for reasons given above and more, we think that Lighty is a smart and proven choice for getting a Drupal site on the web. By all means, feel free to experiment with other servers. Perhaps after seeing what other servers have to offer, you'll agree and come back to Lighty.

Lighttpd

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: