Installing Phusion Passenger on Solaris

Posted by Sam

I know there are other places on the web where you can piece this together but I thought I'd throw up how I got Phusion Passenger compiled on a Solaris 10 zone with Blastwave packages. Well technically the packages are from opencsw.com but they should behave exactly the same (for now). Also, as of the time of this writing the most recent version (2.0.6) didn't compile. I had to grab the trunk from GitHub.

bash-3.00# crle -l /lib:/usr/lib:/opt/csw/lib
bash-3.00# export PATH=/opt/csw/apache2/bin:/opt/csw/apache2/sbin:$PATH
bash-3.00# export APXS2=/opt/csw/apache2/sbin/apxs
bash-3.00# export APR_CONFIG=/opt/csw/apache2/bin/apr-1-config
bash-3.00# gem install passenger
bash-3.00# ./bin/passenger-install-apache2-module

The first line is not something I use regularly and you definitely want to use it with care. Basically it tells the system where to find libraries. Before I added this line Ruby Enterprise Edition and Phusion couldn't find their runtime libraries unless I set LD_LIBRARY_PATH. Relying on LD_LIBRARY_PATH isn't a good idea and didn't work for daemons so I used crle instead. You should run crle first to make sure you don't have other paths set before overriding it.

Once everything finishes you should have a working Passenger install. Note this has only been tested on Solaris 10 x86 update 6. Also, one machine had the gnu version of ld installed and it was causing a weird error. Once I removed SUNWtoo it compiled fine.

Tags: solaris rails passenger apache blastwave opencsw

Showing Blastwave Packages with Upgrades Available

Posted by Sam

I love love love Blastwave. I couldn't imagine using Solaris without it. One of the annoying things though is if you want to see if newer packages are available you have to wade through every package that they have. And they have a lot. So here is a super simple one liner for showing just the packages that need to be upgraded.

pkg-get -c | grep -v "Not installed" | grep -v SAME | \
mailx -s "Blastwave Updates" yourname@example.com

And since you are probably using Solaris Zones here is a simple script that will look in all non-global zones and email out a report. Currently this sends one email per zone but that could easily be changed to send one email per physical box.

#!/usr/bin/sh

for zone in `/usr/sbin/zoneadm list | /usr/bin/grep -v global`; do
   zlogin $zone "/opt/csw/bin/pkg-get -c | \
   /usr/bin/grep -v \"Not installed\" | \
   /usr/bin/grep -v SAME | \
   /usr/bin/mailx -s \"Blastwave Updates for $zone\" yourname@example.com"
done

Tags: solaris blastwave opencsw