LEMP + REE + Passenger

by eclubb
103 deployments · 16 still active · last rev. 6 years ago

CentOS/Fedora, Ruby Enterprise Edition, hardened PHP, Nxginx (w/ Passenger, PHP-FPM), MySQL

Compatible with: CentOS 5.6
						#!/bin/bash

# <UDF name="db_password" Label="MySQL root Password" />
# <UDF name="ree_version" Label="Ruby Enterprise Edition Version" default="1.8.7-2010.01" example="1.8.7-2010.01" />
# <UDF name="install_prefix" Label="Install Prefix for REE and Passenger" default="/opt/local" example="/opt/local will install REE to /opt/local/ree" />
# <UDF name="rr_env" Label="Rails/Rack environment to run" default="production" />
# <UDF name="install_mysql_gem" label="Install MySQL gem" oneOf="yes,no" />
# <UDF name="install_sqlite_gem" label="Install Sqlite3 gem" oneOf="yes,no" default="no" />

case "$-" in
  *i*)
  PATH=$(cd ${0%/*} && pwd -P)
  source "${PATH}/ssinclude-154"
  source "${PATH}/ssinclude-269"
  source "${PATH}/ssinclude-270"
  ;;
  *)
  source '<ssinclude StackScriptID="154">' # StackScript Bash Library for RH Derivatives
  source '<ssinclude StackScriptID="269">' # REE + Nginx + Passenger Library
  source '<ssinclude StackScriptID="270">' # PHP-FPM Library
  ;;
esac

function doit {
  enable_epel_repo
  system_update
  yum install -y sudo wget htop bzip autoconf

  mysql_install "$DB_PASSWORD" && mysql_tune 40
  chkconfig --level 35 mysqld on

  ree_nginx_passenger_install
  chkconfig --level 35 nginx on

  php-fpm_install

  cd ~
  restartServices

  #read -p "Press any key to continue... " -n1 -s
}

doit | tee /tmp/stack_script.log