Skip to content

Instantly share code, notes, and snippets.

@keighl
Last active December 10, 2015 02:48
Show Gist options
  • Save keighl/4369624 to your computer and use it in GitHub Desktop.
Save keighl/4369624 to your computer and use it in GitHub Desktop.
Ubuntu 12.04 setup script
# Assumes the current user is your 'deploy' user, and has sudo priveledges.
sudo apt-get -y upgrade;
sudo apt-get -y update;
sudo apt-get -y install git-core;
sudo apt-get -y install python-software-properties;
sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libpcre3-dev nodejs openjdk-6-jre libmysqlclient-dev;
# NGINX
sudo add-apt-repository ppa:nginx/stable;
sudo apt-get -y update;
sudo apt-get -y install nginx;
# NTP
sudo apt-get -y install ntp;
# IMAGEMAGICK
sudo apt-get -y install imagemagick libmagickwand-dev;
# RBENV
cd;
git clone git://github.com/sstephenson/rbenv.git .rbenv;
touch ~/.bash_profile;
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile;
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile;
source ~/.bash_profile;
# RUBY
mkdir -p ~/.rbenv/plugins;
cd ~/.rbenv/plugins;
git clone git://github.com/sstephenson/ruby-build.git;
rbenv install 1.9.3-p194;
rbenv rehash;
rbenv global 1.9.3-p194;
rbenv rehash;
gem install bundler --no-ri --no-rdoc;
rbenv rehash;
# Get to know github
ssh [email protected];
# Mysql ... if you want init
# sudo apt-get -y install mysql-server mysql-client libmysqlclient-dev;
# mysql --user=root mysql -p;
# mysql> create database DBNAME;
# mysql> GRANT ALL ON DBNAME.* TO USERNAME@localhost IDENTIFIED BY 'PASSWORD';
# Elastic Search
# cd ~
# sudo apt-get install openjdk-7-jre-headless -y;
# wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
# tar -xf elasticsearch.tar.gz
# rm elasticsearch.tar.gz
# sudo mv elasticsearch-* elasticsearch
# sudo mv elasticsearch /usr/local/share
# curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
# sudo mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/
# rm -Rf *servicewrapper*
# sudo /usr/local/share/elasticsearch/bin/service/elasticsearch install
# sudo ln -s `readlink -f /usr/local/share/elasticsearch/bin/service/elasticsearch` /usr/local/bin/rcelasticsearch
# If you want to run elastic search on a small instance:
# nano /usr/local/share/elasticsearch/bin/service/elasticsearch.conf
# Lower ES_HEAP_SIZE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment