Skip to content

Instantly share code, notes, and snippets.

@olancheg
Created July 25, 2012 13:13
Show Gist options
  • Save olancheg/3176129 to your computer and use it in GitHub Desktop.
Save olancheg/3176129 to your computer and use it in GitHub Desktop.
init centos servers
curl -kL https://get.rvm.io | bash -s stable
echo "source /etc/profile.d/rvm.sh" >> /etc/profile
source /etc/profile
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel git-core postgresql-devel.i686 postfix
rvm pkg install readline
rvm install 1.9.3
rvm use 1.9.3 --default
groupadd www-data
adduser -g www-data deployer
echo "deployer ALL=(ALL) ALL" > /etc/sudoers.d/01_deployer
chmod 0440 /etc/sudoers.d/01_deployer
password=`openssl passwd -1 'Q1w2E3R4t5'`
ruby -pi.bak -e "gsub(/^(\w+):[^:]+/, '\1:$password') if \$_ =~ /deployer/" /etc/shadow
rpm -Uv http://centos.alt.ru/pub/repository/centos/6/i386/redis-2.4.15-1.el6.i686.rpm
curl -Lk https://raw.github.com/gist/3205358/af482e6e5207b2886419f5fc02d2080f3b6e8853/god.sh > /etc/rc.d/init.d/god
chmod +x /etc/rc.d/init.d/god
chkconfig postfix on
chkconfig god on
chkconfig redis on
service redis start
service postfix start
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/UTC /etc/localtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment