Archive

Posts Tagged ‘lighttpd’

Simplify Dropbox URLs with Lighttpd

February 26th, 2009 2 comments

Some time ago I posted on how to simplify your dropbox URLs by using .htaccess files within Apache web server. Now that I’ve switched to Lighttpd I needed to find the equivalent. Here is what I came up with:


## dropbox redirection
server.modules += ( "mod_redirect" )


$HTTP["url"] =~ "^/dropbox/(.*)" {
url.redirect = (
"^/dropbox/(.*)" => "http://dl.getdropbox.com/u/123456/$1"
)
}

note: if you already have mod_redirect loaded elsewhere you won’t need to worry about that first line. Also note that you’ll need to update the dl.getdropbox.com URL with your unique string. Replace 123456 with your unique value. You can find this value within your Dropbox account.

Categories: GNOME Tags: , ,

Simplest WordPress Permalink Solution for Lighttpd

February 23rd, 2009 12 comments

As some of you have read, I recently switched this production web server over to Lighttpd, and so far I am very much impressed.  I have been tinkering with Lighttpd for some time, and I really feel it is a fine replacement for Apache.  It supports all the same basic modules that I need (mod_rewrite, mod_alias, mod_auth, etc) and uses far less resources.  The only difficulty in switching is migrating the configuration and little “tweaks” to get things setup just right.

One thing, for example, is that WordPress assumes an Apache server, or something that supports .htaccess files.  This is not the case with Lighttpd, but is solved very, very simply.  Early in my migration I read a number of blog posts suggesting solutions to the WordPress Permalink setup, some more complicated than others.  I have to say that I think I found the simplest solution, and it is rarely seen on other blogs.  Below is one line that will support any WordPress Permalink setup you want:

## Permalink Support:
server.error-handler-404 = "/index.php"

That’s all there is to it.  That one line in the lighttpd.conf will handle the permalinks internally and nothing more is required.  No dealing with weird regex patterns and trying to exclude this or that.  Lighttpd is smart enough to handle it internally with that line.

If you are using a more complex Permalink rewrite configuration in Lighttpd I’d be interested in hearing if this does or does not achieve the same results.

Categories: Wordpress Tags: ,

Server Migration Complete

February 22nd, 2009 5 comments

Well it appears that the server migration is complete, and so far I am very happy with the results.  First of all, I don’t think there was much downtime, if any at all.  The only oddity that I encountered was regarding DNS propogation, and there is only so much you can do about that.  Here is basically what I’ve setup:

  • lighttpd + fastcgi + xcache : very efficient web server + virtual hosts
  • bind9 : slave server (ns3)
  • postfix + postgrey : mail relay (mx3)
  • mysql + tuning-primer.sh : well tuned database backend

So far I am very impressed with the setup at linode.  They have a really nice web management tool and they are very responsive to questions and support.  The price is affordable as well–I hope the performance I’ve been seeing keeps up.  So far all four processors sit idling the majoritiy of the day, and RAM sits at about 200M/360M total.  That was unheard of with my previous setup using Apache, and I wasn’t running BIND previously either.  I think I’m sold on lighttpd!

Please let me know if you encounter any oddities with the site.  Thank you – Christer

Categories: News Tags: , , , ,

Web Server Rebuild and Migration: Apache to lighttpd

February 19th, 2009 2 comments

I know many of you may think I’ve given up and stopped blogging completely. That is not entirely the case. I’ve been overloaded at work, doing over 160 hrs over two weeks in late January and continuing to work later hours than the normal 9-5.

Things appear to be slowing down a bit so I’m preparing to rebuild and migrate the web server this site runs on. Just a heads-up that there may be little bits of downtime over the next week or so.

Also, I’m planning on using lighttpd instead of apache this time around, and I’m looking at php optimizers like fastcgi or xcache. If you have any experience with those I’d love to hear from you.

Categories: Ubuntu Tags: , ,

Install Lighttpd with PHP FastCGI on Ubuntu 8.10

November 9th, 2008 6 comments

In my attempts to performance tune the blog I’ve been looking at alternate web servers, primarily lighttpd.  One of the initial issues that I had with an attempted migration was that of enabling php.  With Apache php had been simple, but lighttpd needed a bit more.

To install a php fastcgi enabled web server using lighttpd you’ll need the following packages:

sudo aptitude install lighttpd php5-cgi

The trick after installing is to activate the fastcgi module included with lighttpd.  This is done using:

sudo lighttpd-enable-mod fastcgi
sudo /etc/init.d/lighttpd reload

In order to test this you can create a file within your document root (likely /var/www/) called info.php, with the following contents (remove the excess spaces):

< ? php
phpinfo();
? >

Now you should be able to access your site, http://example.com/info.php.  If you get a fancy list of php options you’re done!

Categories: Web Development Tags: , ,