I gave up on Lighty.

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Garrett Albright's picture

Well, after years of waiting for version 1.5 to come out, I finally decided to give up recently when upgrading between sub-point-releases of 1.4 on my VPS caused my site to go down (again) and I couldn't quickly figure out why. Yep, even though I founded the Lighty GDO group, I'm running nothing but Nginx now, both on my VPS and locally. Here's a few quick thoughts on the switching experience.

It's still sadly true that Nginx's configuration files are not nearly as fun to work with as Lighty's, with their logical syntax and abundant comments. However, you can ignore the ones that ship with Nginx and instead check out this Github project, which will help you get set up with Drupal-friendly config files pretty quickly. I still had to tweak the files quite a bit to work around all the Linux-isms in them on my FreeBSD VPS and OS X local box, but it was still more pleasant than starting from scratch, and the files are far better commented. Just be sure to follow the installation and set-up instructions (near the bottom of the readme file for some reason) closely and you ought to be fine.

My VPS is humming away just fine, but I'm having a few problems on my local OS X box. Notably, every thirty seconds, garbage along the lines of this is being dumped into the Nginx error log; as if maybe a second copy of Nginx is trying to fire up and bind to port 80 but isn't able to because it's already bound. Seemingly harmless, but annoying (if anyone knows how to make it go away, please share). Also, redirecting of www.example.com to example.com doesn't seem to be working locally, but it's not nearly important for this to work locally as it is on my live server, so I'll live.

Getting PHP working with Nginx means using PHP-FPM, which, long story short, is a new-and-improved way to have a server talk to PHP by using sockets instead of CGI (PHP runs as a daemon/server). Unfortunately, this is Yet Another Thing To Set Up; fortunately, compared to Nginx itself, it's not that tough - you basically edit a config file to tell PHP what socket it should work at and what user it should run as (ProTip: you probably want it to use the same user as Nginx itself), then edit the Nginx config file to point to that same socket. However, I had some weirdness when trying to get this running locally as well; PHP-FPM wasn't reading the same config files that PHP as CLI or CGI were reading, causing a lot of stuff (including PDO) to not work. Once I figured out what was happening, I symlinked the config files to where PHP-FPM was looking for them, and now everything's hunky-dory. (Note that this weirdness was encountered using ports installed with MacPorts; YMMV with other port/package systems.)

So switching wasn't easy, but so far, so good. It's clear that Nginx has a lot more momentum and support behind it compared to Lighty, and probably a much brighter future, so as much as I was rooting for Lighty as the little server that could, its occasional frustrations and unclear future made making the switch an appealing decision. Let's see if it was the right one.

Comments

Conflicting listen directives?

mesch's picture

I've encountered that problem in the past, and it went away when apache2 was fully uninstalled (though I kept the very useful apache2-utils). In that case though, nginx wouldn't even start. Perhaps that could occur if you have conflicting listen directives somewhere in your nginx config. netstat might shed some light on the subject too.

+1 for perusio's config. I've been running nginx for a while in large measure because of all the great support in the Drupal nginx group. So far, no problems with upgrades.

I recently started using Ubuntu 12.04 LTS and its great for hosting Drupal sites with nginx because:

  • nginx.org provides a source for package management (great if you don't need to enable/disable certain modules)
  • php5-fpm is available in the default repositories (not true with 10.04)
  • php5-fpm on Ubuntu 12.04 meets the minimum version requirements of Drupal 8 (10.04 doesn't)
  • of course, its LTS so hopefully no need to upgrade for a good long while

Lighttpd

Group organizers

Group notifications

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

Hot content this week