rails3

by ouyangzhiping
4 deployments · 0 still active · last rev. 5 years ago

rails3,support Ubuntu 11.04

Compatible with: No distros currently supported
						#!/bin/bash
#
#
#
# <UDF name="DB_ROOT_PASSWORD"   Label="Your Database Password" />
# <UDF name="RAILS_DOMAIN1"   Label="Your RailsApp Domain" />
# <UDF name="RAILS_DOMAIN2"   Label="Your RailsApp Domain"/> 

#install aptitude and git
apt-get install -y aptitude
aptitude install -y git-core >/dev/null 2>&1
aptitude install -y git >/dev/null 2>&1

#install and source yourchili
git clone git://github.com/cngithub/yourchili.git
cd yourchili
./install.sh
source /usr/local/lib/yourchili/yourchili.sh

#updates packages to latest versions
upgrade_system

#set hostname and allowed ports
#keep port 443 open in case someone wants to enable SSL later
set_hostname "$RAILS_DOMAIN1"
set_open_ports 22 80 443

#install mysql
mysql_install "$DB_ROOT_PASSWORD"
mysql_tune 40

#install nginx and run under user-name www-data
nginx_install "www-data"  "www-data" "0" "1" "0"

create virtual host for rails site1
nginx_create_site "$RAILS_DOMAIN1"        "$RAILS_DOMAIN1 www.$RAILS_DOMAIN1"               0 "" 0 0
nginx_ensite "$RAILS_DOMAIN1" 

create virtual host for rails site2
nginx_create_site "$RAILS_DOMAIN2"        "$RAILS_DOMAIN2 www.$RAILS_DOMAIN2"               0 "" 0 0
nginx_ensite "$RAILS_DOMAIN2"

nginx_delete_site default