Phusion Passenger (mod_rails) + DreamHost FTW!

I just converted five production sites from my custom-built lighttpd installation to Passenger on DreamHost.  The speed is impressive, and I only had to update a couple things in environment.rb to get one site to work.

DreamHost now appears to be a bonafide Rails Host!  Who knew?!

The Guy posted this article on May 15th, 2008.

Tagged

Categorized

Leave a comment (You'd be the first)→

techno

xckd rules.

(And I like techno.)

The Guy posted this article on April 16th, 2008.

Tagged

Categorized

A few notes on using Passenger (mod_rails) with Mac OS X

I installed Phusion Passenger aka mod_rails this evening on my Leopard installation.  It didn’t go quite as smoothly as I’d expected, although it did ultimately work.  If you’re having some issues getting it running, this may help.

The first thing that went “awry” was the fact I was using Mac OS X at all.  There is something wrong/non-standard with the apache2 installation included with Leopard, and Passenger doesn’t work with it.  When I ran the passenger-install-apache2-module utility I was notified of this, and the tool suggested installing a new copy of apache2.  Rather than compile it manually, I opted to go the MacPorts route.

Unfortunately, that too had a problem: it wouldn’t compile.  A quick perusal of the configure script log indicated that a suitable version of awk wasn’t installed, and the portfile didn’t know enough to install a proper version as a prerequisite.  A quick sudo port install gawk took care of that.

I then reran the passenger-install-apache2-module, which didn’t automatically locate the new apache installation.  I followed the instructions to set the APXS2 environment variable, but it didn’t take.  Ultimately the problem ended up being that the new apxs wasn’t on my path.  I updated it in my .profile to include /opt/local/apache2/bin, which fixed that issue.

In order to ensure no additional conflicts, I deactivated web sharing in OS X.  This disables the built-in apache installation.  I then copied the sample apache configuration file in the /opt/local/apache2/conf/ directory to httpd.conf, and added the lines requested by the tool.  Next I configured apache’s virtual host file to point to a new hosts.conf I created in the same directory.  From there I added a virtual host as instructed to point to my Rails app.

Upon visiting localhost in a web browser my app fired right up, but none of my styles or javascripts loaded.  It turns out I had to add a <Directory> directive in the vhost with the contents allow from all.  That fixed the last issue.  Note that by default Passenger runs your app in production mode.  The documentation states to change this in your config/environment.rb file, but when I tried it this didn’t work.  You can add a RailsEnv development to your httpd.conf, but this is a global setting.  I’ve logged this bug in the tracker.

Despite these glitches, I’m really excited about Passenger.  I went through the installation process at work earlier today on a CentOS installation, and it went seamlessly.  Most of us aren’t deploying to Mac OS X, so I’m willing to overlook the minor shortcomings on OS X because the Linux deployment went so well.  In either case, it’s free, and it’s only going to get better from here.

Passenger has the power to do wonderful things for the Rails community.  It will be very interesting to see this start to roll out at shared web hosts around the globe.  The widespread availability of cheap, easy Rails hosting could be a game-changer.  I look forward to meeting the fine fellows at Phusion at RailsConf this year.

If you find Passenger useful, please consider donating to the Phusion guys.  They’ve sweat a lot of time into this code, and as far as 1.0 releases go you couldn’t ask for much more.

The Guy posted this article on April 12th, 2008.

Tagged

Categorized

Leave a comment (3 so far)→

Vista Source Code

Courtesy of digg.

The Guy posted this article on April 6th, 2008.

Tagged

Categorized

Building FlowPlayer from Source on Mac OS X

FlowPlayer is a Flash media player for the web.  It’s a nice alternative to Jeroen Wijering’s FLV Media Player, although I’d never knock the latter.  It’s still arguably still the best.

One reason to use FlowPlayer is its GPL license.  There aren’t many reasons to build it from source, as the precompiled SWFs work identically.  The only reason I was curious enough to try it was to change the embedded logo in full-screen mode.  FlowPlayer is offered with a “commercial” license, which nets you FlowPlayer minus that logo.  That doesn’t sound like much of a benefit to me.  I’d want a logo there - just not that one.

It occurred to me that CentOS, the free Linux distribution based on Red Hat Enterprise Linux, is able to do exactly that.  They take RHEL, swap out logos and the “Red Hat” phrases, compile, and that’s about it.  It’s a nice way to work with Red Hat without forking over the cash, and it’s legal thanks to the GPL (I’ll still take Debian/Ubuntu any day - enterprise be damned).

This is tangential, but I’m noting it because I’m publishing these instructions simply because I figured it out and there isn’t a lot of good information out there to this effect.  These instructions are based on a somewhat outdated post I found that didn’t make an OS distinction and turned out not to work as written on Macs.

One note before we continue: I’m a developer, and if you’ve read this far I’m assuming you are, too.  I didn’t investigate some of the more basic prerequisites typical for development on Mac OS X, as I’ve got the Developer kit installed, as well as MacPorts and Fink.  If these instructions don’t work for you, make sure you’ve got the basics ready to go.  We’ll only be using two external tools you probably don’t have, and we won’t be installing them on the system itself.  For the record, I’m running 10.5.2.

Here we go:

  1. Head over to the FlowPlayer project page and download the FlowPlayer sources.
  2. Download swfmill v0.2.11 to the same directory where you downloaded FlowPlayer.  As of this writing the current version is 0.2.12.  This version does not work with FlowPlayer as it’s currently written, so I’ve linked to the older version.  It is possible by the time you read this that a new version that does work is available.  Google accordingly.
  3. Download the mtasc Mac OS X package from the Motion Twin web site to the same directory where you downloaded FlowPlayer.
  4. Open a Terminal, cd to the directory where you downloaded the archives, and extract them:
    $ unzip flowplayer-2.0.1-src.zip
    $ unzip mtasc-1.12-osx.zip
    $ tar zxf swfmill-0.2.11-macosx.tar.gz
  5. Copy the binaries into their respective directories:
    $ cp swfmill-0.2.11-macosx/swfmill flowplayer-src/bin/swfmill/
    $ cp mtasc-1.12-osx/mtasc flowplayer-src/bin/mtasc
  6. cd into each directory, rm the Windows binaries, and symlink the Mac OS X versions:
    $ cd flowplayer-src/bin/mtasc/
    $ rm mtasc.exe
    $ ln -s mtasc mtasc.exe
    $ cd ../swfmill/
    $ rm swfmill.exe
    $ ln -s swfmill swfmill.exe
    $ cd ../../
  7. At this point you should be in the flowplayer-src directory. It’s time to compile!
    $ ant
  8. If all went according to plan, you’ll see some text output as the compile progresses. You should see the following lines at the end (your build time will vary):
    BUILD SUCCESSFUL
    Total time: 22 seconds
  9. You’ll find the various players in the build/ directory.  As a quick test, open FlowPlayer.html in a text editor, and look for ../FlowPlayerDark.html. Remove the ../ at the beginning so it just reads FlowPlayerDark.html. Next, search for http://flowplayer.org/video/honda_accord.flv and replace it with a reference to another FLV (the original doesn’t currently exist on the FlowPlayer web site).  Save the file. Open it up in your favorite web browser, and you should see the player.

That’s all there is to it.  Feel free to get in touch if you find anything amiss.  This just worked for me.

The Guy posted this article on March 25th, 2008.

Tagged

Categorized

Leave a comment (4 so far)→

Happy, Gymnast vs Salmon

This is the first post here under a new category by the name of Addendum.  I’ll be using it for miscellaneous items that aren’t necessarily Links, or don’t warrant a whole post.

I have fallen in love with this track.  You should check it out.  It’s a remix of Max Sedgley’s Happy.

If you’re looking for a good time with some of the best guys around, Darrell’s house can’t be beat.  On the topic of one of his recent drunken sexual encounters, he shared a choice quote:

She’s not a gymnast… More of a salmon.

FTW!

The Guy posted this article on March 24th, 2008.

Tagged

Categorized

Leave a comment (You'd be the first)→

Awareness Test

Best ad I’ve seen in ages.  Thanks to E for the link.

The Guy posted this article on March 16th, 2008.

Tagged

Categorized

Apple TV + Streaming Radio = Fail

When Apple announced Apple TV Take 2, I was bummed to see no mention of streaming radio.  It seemed like such a simple way to add value to the product.  After upgrading my box to the new software, I took a peek, saw there was indeed no radio, and went about enjoying the many other great new features.

A couple days ago I was fooling around in iTunes and discovered that you can create a playlist and drag individual stations from the station browser to it.  That playlist will show up on the Apple TV.  I opened it up, picked ETN.fm 1, and was thrilled to hear music most of my friends hate.  Zeke and I listened for a bit, and went about the evening’s business.

Yesterday as I was preparing for my workout I figured I’d tune into the radio on the Apple TV.  I hit Play and after a moment it resumed the same stream.  Sweet!  Not my favorite style of stuff, but hey - it’s free, and I’ve never heard it.  I got down to business.  About halfway through I was taking a breather and figured I’d change the channel.   I paused the station, tapped the button to see the playlists, and was rather surprised to find that the Radio playlist was gone.  Thinking perhaps I’d managed to navigate to a different menu inadvertently, I took a look around to see if there was any clue.  There wasn’t.  The odd thing of it is that I could hit the Now Playing option, and restart the paused stream.  The indicator even showed the 20 of 71, telling me where in the playlist I was.

I haven’t done any formal testing to prove this, but all of this seems to be unintended behavior.  The Apple TV is configured by default to sync as much content from the host machine as possible, but it has always been possible to stream whatever content is in iTunes on the host machine that for one reason or another (disk space constraints or user choice) aren’t copied to the device.  The original Apple TV software required the user to explicitly choose a host machine from which to stream, but the Take 2 software makes the whole process automatic.  If iTunes is open and properly configured, the Apple TV will automatically mix in the host’s content with the synced.  It’s pretty elegant, and makes the process as seamless as possible.

Well, the Apple TV saw the Radio playlist in iTunes and made those “tracks” available for play.  I had assumed when I first discovered the trick that iTunes was pulling down the stream and passing it back to the Apple TV, but knowing that the host machine wasn’t on when I tried it the last time, it’s obvious that the Apple TV is pulling the stream down on its own.  This proves conclusively that not only is the Apple TV capable of playing streaming radio, but also that the Apple TV software already has a working implementation of it.

What the fuck?!

Apple takes the time to do the gruntwork of building out the actual implementation and explicitly chooses not to allow the end-user to make full use of it?  There are many Microsoft fanboys out there who’ll say that’s just the way things are with Apple, but it wasn’t until this particular issue came up that I actually felt like I’d lost something as a result.  This device has been crippled in a specific way, and I can’t think of a single reason to justify it.

I’m the kind of guy who tends to agree with the decisions Apple makes.  Certainly not all the time, but on the whole I think they’ve managed to figure out a business model that makes me feel like it works for me as much as it works for them.  I make a living hammering away on a MacBook Pro.  I use an iPhone to keep in touch with email and the web when I’m away from the desk.  Apple makes some stuff that I miss when it’s not there.

I’m also the kind of guy who always turns to iTunes or Amazon MP3 when I hear a track I want to own, and it’s rare that there’s something I hear I can’t find legally.  Hell, the very night I discovered all of this I bought one of the tracks I heard streaming on ETN.fm from iTunes!

It’s a shame this company places such limits on its own products.  I totally get Apple not going out of its way to put Flash on the iPhone, but I don’t get Apple explicitly avoiding functionality when it’s already taken the time to implement it.

The Guy posted this article on March 14th, 2008.

Tagged

Categorized

Leave a comment (1 so far)→

“I’m kind of an agnostic.”

Stephen Colbert to Hussein Ibish on tonight’s Colbert Report:

 So there might not be any god but Allah, and Mohammed might be his prophet.

Ibish’s response:

 I don’t know, and neither do you, and neither does anyone else.

Rock on, brother.

The Guy posted this article on March 14th, 2008.

Tagged

Categorized

This town’s mayor is a fucking mutt.

I try.  I really try.  I try really hard to believe that those red states are filled with good, honest, intelligent people.  They don’t really think that evolution is just a theory, or that we’re all really cousins.

I do believe most of them are good at heart, and that they often believe they’re being honest.  But that intelligence thing… yeah.  I don’t think I’ll ever believe to believe that nonsense.

The Guy posted this article on March 13th, 2008.

Tagged

Categorized

This is my blog. Who am I? That's a swell question.

2fkd is proudly powered by WordPress
Entries (RSS) and Comments (RSS).