railsphp

by ouyangzhiping
35 deployments · 1 still active · last rev. 5 years ago

rails website+ wordpress website

Compatible with: No distros currently supported
						#!/bin/bash
#
#
#
# <UDF name="WP_DOMAIN"          Label="The Domain Name Of Your WordPress Site"    example="librarian-blog.com"   />
# <UDF name="WP_TITLE"           Label="The Name Of Your WordPress Blog"           example="The Librarian's Blog" />
# <UDF name="WP_USER"            Label="Your WordPress Login Name"                 example="Librarian"            />
# <UDF name="WP_PASSWORD"        Label="Your WordPress Password"                                                  />
# <UDF name="WP_EMAIL"           Label="Your WordPress Contact Email Address"      example="librarian@uu.edu.am"  />
# <UDF name="DB_ROOT_PASSWORD"   Label="Your WordPress 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 "$WP_DOMAIN"
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" "1" "1" "0"

#create virtual host for wordpress site
nginx_create_site "$WP_DOMAIN"        "$WP_DOMAIN www.$WP_DOMAIN"               0 "" 1 0
nginx_ensite "$WP_DOMAIN"

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

#install wordpress
better_wordpress_install "$DB_ROOT_PASSWORD" "$WP_DOMAIN" "$WP_USER" "$WP_PASSWORD" "$WP_TITLE" "$WP_EMAIL"