Last active
November 21, 2015 13:41
-
-
Save juuh42dias/14c2b473ab59552a7c2c to your computer and use it in GitHub Desktop.
Provisioning Web Server Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PATH | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
# Store the base dir | |
BASEDIR=$( cd $(dirname $0); pwd) | |
# Get all dependencies | |
echo "" | |
echo "Update & Upgrade Server Ubuntu" | |
echo "" | |
sudo apt-get -y update && sudo apt-get -y upgrade | |
echo "" | |
echo "Clean Instalation Ubuntu" | |
echo "" | |
sudo apt-get autoremove && sudo apt-get autoclean | |
echo "" | |
echo "Install Packages and Libs" | |
echo "" | |
sudo apt-get -y install build-essential vim openssl curl git git-core libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev zip unzip libpcre3 libpcre3-dev make g++ autoconf automake imagemagick python-software-properties | |
sudo apt-get -y install bison libc6-dev libffi-dev libreadline6 libreadline6-dev libsqlite3-dev libtool libxml2-dev libxslt-dev libxslt1-dev libyaml-dev ncurses-dev zlib1g zlib1g-dev libreadline-dev flex libpq-dev memcached | |
sudo apt-get install curl 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 -y | |
sudo apt-get -y install linux-headers-$(uname -r) libcurl4-openssl-dev libmagickwand-dev ufw htop atop | |
# Install GCC | |
sudo apt-get install gcc -y | |
# Install PostgreSQL 9.4 | |
echo "" | |
echo "Install PostgreSQL 9.4" | |
echo "" | |
sudo add-apt-repository ppa:pitti/postgresql && sudo apt-get update && sudo apt-get install postgresql-9.4 | |
sudo apt-get install postgresql postgresql-contrib libpq-dev -y | |
# Install Firewall | |
echo "" | |
echo "Firewall Ubuntu UFW" | |
echo "" | |
sudo ufw default deny | |
sudo ufw enable | |
sudo ufw logging on | |
sudo ufw allow ssh | |
sudo ufw allow www | |
# Install LibYAML | |
echo "" | |
echo "Install LibYAML" | |
echo "" | |
mkdir ~/install | |
cd ~/install | |
#wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz | |
wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz | |
tar -zxf yaml-0.1.6.tar.gz | |
cd yaml-0.1.6 | |
./configure && make && sudo make install | |
# Install NodeJs | |
echo "" | |
echo "Install NodeJs" | |
echo "" | |
curl -sL https://deb.nodesource.com/setup | sudo bash - | |
sudo apt-get update && sudo apt-get install nodejs | |
# Install Ruby 2.2.0 | |
echo "" | |
echo "Install Ruby 2.1.7" | |
echo "" | |
cd ~/install | |
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.7.tar.gz | |
tar xzvf ruby-2.1.7.tar.gz | |
cd ruby-2.1.7 | |
./configure && make && sudo make install | |
echo "" | |
echo "Gem Update System" | |
echo "" | |
# Gem Update | |
sudo gem update --system | |
sudo gem install bundle | |
sudo gem install unicorn | |
# sudo gem install puma | |
echo "" | |
echo "Install Ngnix" | |
echo "" | |
cd ~/install | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
touch nginx.list | |
echo "deb http://nginx.org/packages/ubuntu/ precise nginx" >> nginx.list | |
echo "deb-src http://nginx.org/packages/ubuntu/ precise nginx" >> nginx.list | |
sudo cp ~/install/nginx.list /etc/apt/sources.list.d/ | |
sudo apt-get update -y | |
sudo apt-get install -y nginx | |
sudo apt-get install clamav -y | |
# sudo apt-get install postfix -y | |
sudo apt-get courier-pop -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update NodeJS