Ubuntu+MongoDB+NGINX+Passenger+REE+Rails+Git

by ip_fix
16 deployments · 3 still active · last rev. 5 years ago

Install on Ubuntu the lastest version of:

- MongoDB (mongodb-stable)
- NGINX (0.8.53)
- Passenger (3.0.2)
- Ruby Enterprise Edition (1.8.7)
- Rails (3.0.5)
- Git (1.7.0)

A complete web enviroment for rails development!

Compatible with: No distros currently supported
						#!/bin/bash
#
# Install a web enviroment with Ruby Enterprise Edition, NGINX, Passenger, Git and Rails.
#
# Written by IP_FIX <eversonfix@gmail.com>
# GitHub - https://github.com/eversonfix
#
# Based on Nigma StackScripts - http://github.com/nigma/StackScripts 
#
# 03/2011
#
# <UDF name="user_name" label="Unprivileged user account name" />
# <UDF name="user_password" label="Unprivileged user password" />
# <UDF name="sys_hostname" Label="System hostname" default="myvps" example="Name of your server, i.e. linode1" />
# <UDF name="base_data_directory" Label="Base data directory for MongoDB" default="/opt" example="/opt will install MongoDB to /opt/mongodb" />
# <UDF name="nginx_prefix" Label="Install Prefix for NGINX" default="/opt" example="/opt will install NGINX to /opt/nginx" />

exec &> /root/stackscript.log

source <ssinclude StackScriptID="1"> # StackScript Bash Library
system_update
goodstuff

source <ssinclude StackScriptID="123"> # lib-system-ubuntu
system_enable_universe

# source <ssinclude StackScriptID="123"> # lib-system-ubuntu
# Configure system
system_update_locale_en_US_UTF_8
system_update_hostname "$SYS_HOSTNAME"

system_add_user "$USER_NAME" "$USER_PASSWORD" "sudo"

source <ssinclude StackScriptID="128"> # lib-mongodb
system_configure_mongodb_repository
mongodb_install "$BASE_DATA_DIRECTORY"

# Ruby Enterprise Edition Setup

wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2011.03_i386_ubuntu10.04.deb
dpkg -i ruby-enterprise_1.8.7-2011.03_i386_ubuntu10.04.deb

apt-get -y install build-essential libcurl4-openssl-dev git-core

# NGINX+Passenger Setup

passenger-install-nginx-module --auto --auto-download --prefix="$NGINX_PREFIX/nginx"

# Startup script

ln -s "$NGINX_PREFIX/nginx" "/opt/nginx"
wget http://library.linode.com/web-servers/nginx/installation/reference/init-deb.sh
mv init-deb.sh /etc/init.d/nginx
chmod +x /etc/init.d/nginx
/usr/sbin/update-rc.d -f nginx defaults

# Install Rails 3

gem update --system
gem install rails --no-ri --no-rdoc

# Postfix

postfix_install_loopback_only

restartServices