Apache + Passenger

by ratnikov
4 deployments · 1 still active · last rev. 6 years ago

Installs Apache and Passenger module

Compatible with: No distros currently supported
						#!/bin/bash

if [ ! -n "$INSTALL_PREFIX" ]; then
  INSTALL_PREFIX=/opt
fi

if [ ! -n "$TMPDIR" ]; then
  TMPDIR=/var/tmp
fi

if [ ! -n "`gem search passenger | awk '{ print $1 }'`" ]; then
  echo "Installing passenger gem"
  gem install passenger --no-ri --no-rdoc
  echo "Done!"
fi

PASSENGER_ROOT=`passenger-config --root`

# install required apache packages
apt-get install -y apache2 apache2-mpm-prefork apache2-prefork-dev

echo "Building apache2 passenger module..."
if [ -n "`passenger-install-apache2-module --auto | grep 'Some required software not installed'`" ]; then
  echo "Failed to install passenger. Skipping the rest... :("
  exit 1
fi

echo "Enabling passenger module..."

echo -e "# Automatically generated configuration for passenger module\n\n\
LoadModule passenger_module $PASSENGER_ROOT/ext/apache2/mod_passenger.so\n\
PassengerRoot $PASSENGER_ROOT" > /etc/apache2/mods-available/passenger.load

a2enmod passenger

apache2ctl restart

echo "All done!"