Intro to FLPR

Posted by Pat Sat, 20 Aug 2005 07:57:00 GMT

What is FLPR?

If LAMP is the Open Source Web Platform, then FLPR is the Most Excellent Open Source Web Platform. Party on dudes.

FLPR stands for FreeBSD Lighttpd PostgreSQL Rails

Why should I use it?

This is just the opinion of one tiny web developer (but don’t worry, with FLPR, I’m going to take over the world!). There’s tons of debate all over the net on MySQL vs Postgres, FreeBSD vs Linux, Rails vs PHP/ASP/Java/FlavorOfTheWeek.

Here are my thoughts on it. I’m actually going to explain it all in reverse order. As I mentioned, there’s already a ton of exiting content debating the merits of all the various technologies. I’m just going to discuss why I use this particular setup (besides the obvious fact that it makes a cool acronym).

  • Rails – This is just a sweet, sweet web framework. That’s basically my reasoning for using it. Development is easy and just makes sense. I can code a lot faster in it than Java (my previous lang of choice), and it’s (gasp!) fun.
  • PostgreSQL – This is about as enterprise a database as you can get and still be free. Free as in beer, free as in speech. Can’t beat that. Views, stored procedures, and it’s been totally solid and lightning quick for me. I feel in general it’s superior to MySQL, and Rails has awesome support for it, so it just makes sense. Plus it’s true open source, vs MySQL’s pseudo-open source ;)
  • lighttpd – Apache is the de facto for web hosting…except in Rails apps. I’m not even sure why, really. Basically it’s taht Rails has to run as a CGI app, Rails in CGI is slooooow so you have to use FastCGI, and lighttpd + FastCGI is super quick. I’ve just played around with it a bit and it seems pretty nice so far. It’s been very stable (no crashes yet), very fast, and uses less resources than Apache. Most excellent.
  • FreeBSD – This, as they say on MTV’s Cribs, is where the magic happens. I think this is the best server OS around right now. Solid, fast, secure…and maintaining it is super easy. Best of all, I think Rails was written to run on it, because of how easy it is. Have problems installing Ruby and Rails on another OS? Not on FreeBSD! Installing the pure Postgres adapter is a cakewalk when you install from ports, compared to being a pain in every other OS I’ve tried.

Okay so as I look at that list, there isn’t really a compelling reason to use FLPR over LAMP, or any combination of OS, httpd, database, and language. I’ve used a lot of web languages and a lot of OSes, and it really comes down to feel for me. The combination I discuss here just feels right when developing, and so far it’s been a winner in production.

I think the FLPR combo is absolutely killer for developing and deploying web apps. If you like it, awesome, if not, that’s cool too. Over the next week, I’ll be posting instructions on how to build a FLPR machine from scratch. The point of this will be to build a machine that can host your web applications online, and eventually I hope to incorporate all aspects of a standard internet server (web, ftp, etc).

Why can’t I use Linux?

Cause then you’re a LLPR, and that means your apps fall apart. (I’ll be here all week, don’t forget to tip your waitress)

Posted in  | Tags , , , ,  | 10 comments

Comments

  1. dyn said 5 days later:

    Nice article.. feels a bit flamebait though :) I wonder, how much harder is it to set up these eg. on OpenBSD?

  2. Pat said 5 days later:

    Hey dyn,

    So much of web development is simply a matter of personal preference. It’s entirely possible to develop any application with LAMP that you could with FLPR. But you could do the same thing in assembly as well…it just takes longer.

    I understand that the article could be considered flamebait, but in reality it doesn’t matter a whole lot what you use. As I state in there, this combination of tools is incredibly easy for me to develop with, and it just feels right. Long-running debates are irrelevant, because I don’t think any existing platform is technically superior to another. At least not enough to argue over it.

    Hopefully you’ll find the subsequent articles to be helpful and technically sound.

    Pat

  3. Kim said 10 days later:

    In your description of lighttpd.config for Typo, the url_rewrite derective does the following. This derective contains 2 rewrite rules.

    /$” => “index.html”

    This rule says to map empty requests to index.html. So if someone accessed your site as “http://www.flpr.org/”, it would be mapped to “http://www.flpr.org/index.html”.

    “([^.]+)$” => ”$1.html”

    This rule says to map requests that contain a file without an extent to a file with an “html” extent. If someone accessed your site as “http://www.flpr.org/some/file”, it would be mapped to “http://www.flpr.org/some/file.html

    This works in conjunction with the server.error-handler-404 = ”/dispatch.fcgi” derective. The way it works is after doing the mapping with the url-rewrite derective, if it finds the files under your document root, they are served as normal static content. If the files are not found, it then invokes the dispatch.fcgi script through the fast CGI handler. The dispatch.fcgi script parses out the various components of the URL request to produce the controller, action, id, and other parameters passed into the Rails app.

  4. Cesc said 75 days later:

    Nice article. I’m planning to move this weekend my Debian Server running Lighttpd and SQLite to FreeBSD and finding this site will help me on my move. Thanks a lot for starting this new “blog/project”

  5. Yogi said 175 days later:

    Hi Pat,

    This is exactly the platform that I plan on using for my upcoming rails websites, but I haven’t found a hosting provider that seems right.

    Could you share some experiences on hosting providers you use (or have heard of) for FLPR apps.

    -Yogi

  6. Pat said 175 days later:

    Hey Yogi,

    I don’t know of any hosting providers that host on this platform. Your best bet is to get a dedicated server or a VPS, most likely. My server is hosted at LayeredTech, who I absolutely love. However if you’re only running a couple small apps a dedi would be overkill, so you’d want to go with a VPS to save $$. Ezra Zygmuntowicz says he’s had good luck with http://rimuhosting.com. His blog is worth reading for deployment info, and he’s actually writing a deployment book that will be published by PP.

    Lately I’ve kind of been thinking about offering FLPR hosting..not sure what kind of interest there would be though. In fact I think I’ll make a post now just to get an idea :)

  7. Ajay said 179 days later:

    Hey Pat, Thanks for the setup info. Textdrive is a FLPR host, though you have to file a ticket to enable L and P. It’s fairly easy to do and I’m on their server now.

  8. ah said 217 days later:

    how do i pronaunce it? flipr or flapr :)

  9. Pat said 217 days later:

    I say “flipper”

  10. Phil said 220 days later:

    I am pretty sure the pure-ruby postgres adapter is really easy to install on any OS. After all, it’s pure ruby—no compiling necessary. (I’ve never heard of anyone having trouble with it.)

    Also, Apache does not require that you use CGI; you can use FastCGI.

(leave url/email »)

   Preview comment