Important lessons in configuration

Mac OS X – Nginx + PHP-FPM + MySQL + Node

Don’t install node packages before reading/understanding what they do. It has unbelievable potential for frustration.

I installed a package called local-tld which is a node package designed to help you manage your hosts file. Then I proceeded to setup Nginx/Fpm/Mysql and completely forgot about it. local-tld, forwards everything coming in on port 80 to itself on port 5999, but when you run the command line to figure it out:

sudo ipfw list – this tells you something is forwarding all port 80 traffic to port 5999

lsof -n -i4TCP:5999 | grep LISTEN – this tells you it’s node, but doesn’t tell you what package it is

Meanwhile, before you get to this point, you’re bashing your head against things screaming ‘Why does it work on port 81 but not on port 80?’

Also, if you’re running Nginx + Fpm, this line is really important, either in your fastcgi_params file, or in the virtual hosts server config somewhere:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

It’s not there by default, but it tells it to pass the php script file location onto the cgi process that has been spawned via PHP-FPM so that FPM knows what file to run. Without, you just get blank white screens. And if you add that line incorrectly, you get a PHP error of ‘File not found’.

Many lessons learned tonight about configuring a dev environment on Mac OS X Mavericks, via Homebrew.

A special shoutout and thanks to this post for all the great information and configs:

Oh and one more, when installing CouchDB via Homebrew, SonicWall blocks the spidermonkey pre-req file from downloading from the mirror, as it matches some kind of Javascript virus signature. Yet another needle in a haystack of dev environment setups.