Skip to content

Instantly share code, notes, and snippets.

@mrichie
Last active December 10, 2015 02:28
Show Gist options
  • Save mrichie/4367339 to your computer and use it in GitHub Desktop.
Save mrichie/4367339 to your computer and use it in GitHub Desktop.
server app
if [ "$(id -u)" -eq "0" ]; then
echo "This script should not be run as root"
exit 1
fi
sudo ntpdate ntp.ubuntu.com
sudo apt-get install gcc -y
sudo apt-get install language-pack-zh-hant language-pack-zh-hans -y
sudo apt-get install yasm imagemagick ghostscript libsasl2-dev libmemcached-dev -y
sudo apt-get install freetds-dev freetds-bin tdsodbc -y
check_app(){
which $1 > /dev/null 2>&1
}
check_app rvm
if [ $? -eq 0 ]; then
echo "exist rvm"
else
curl -L https://get.rvm.io | bash -s stable
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
source ~/.bash_profile
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config -y
fi
check_app ruby
if [ $? -eq 0 ]; then
echo "exist ruby"
else
/home/edoctor/.rvm/bin/rvm install ruby-1.9.3
rvm use 1.9.3 --default
echo "rvm_trust_rvmrcs_flag=1" > ~/.rvmrc
fi
#check_app node
#if [ $? -eq 0 ]; then
# echo "exist node"
#else
# curl https://raw.github.com/eDoctor/install-nodejs-and-spm/master/install-nodejs-and-spm.sh | bash -s 0.8.16
#fi
check_app mongo
if [ $? -eq 0 ]; then
echo "exist mongo"
else
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 -y
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install mongodb-10gen -y
sudo sed -ine "1i\auth=true" /etc/mongodb.conf
fi
check_app nginx
if [ $? -eq 0 ]; then
echo "exist nginx"
else
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key -y
echo "deb http://nginx.org/packages/ubuntu/ precise nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/ubuntu/ precise nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list
sudo apt-get update
sudo apt-get install nginx -y
fi
# ffmpeg
# swftools
#sudo add-apt-repository ppa:guilhem-fr/swftools
#sudo apt-get update
#sudo apt-get install swftools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment