ababup1192
7/7/2015 - 1:40 AM

CentOS7 base

CentOS7 base

# Set Username
user="vagrant"
sudo yum update
sudo yum install -y kernel-devel kernel-headers git vim tmux zsh

# Set Zsh
chsh -s /bin/zsh $user
sudo su - $user -c "curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh"
sudo su - $user -c "git clone --recursive https://github.com/sorin-ionescu/prezto.git /home/$user/.zprezto && \
  git clone https://github.com/ababup1192/dotfiles.git /tmp/dotfiles && \
  cp -r /tmp/dotfiles/.??* /home/$user"
rm -rf /var/tmp/dotfiles

# install JDK8
curl -LO -H "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm"
sudo rpm -Uvh jdk-8u45-linux-x64.rpm
sudo su - $user -c "echo -e \"export JAVA_HOME=/usr/java/default
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar\" >> ~/.zshenv"

# Install PostgreSQL
sudo yum install -y http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
sudo yum groupinstall -y "PostgreSQL Database Server 9.4 PGDG"

# Launch PostgreSQL service
# $ su - postgres
# $ psql
# reference: http://tigertaizo.hatenablog.com/entry/2015/02/11/155036
sudo /usr/pgsql-9.4/bin/postgresql94-setup initdb
sudo systemctl start postgresql-9.4
sudo systemctl enable postgresql-9.4

# Install rbenv
sudo su - $user -c "git clone git://github.com/sstephenson/rbenv.git /home/$user/.rbenv && \
    git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \
    exec /bin/zsh"

# Install mongodb
sudo su -c "echo -e \"[mongodb-org-2.6]
name=MongoDB 2.6 Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1\" > /etc/yum.repos.d/mongodb.repo"
sudo yum install -y mongodb-org
sudo mkdir -p /data/db
# Launch MongoDB
sudo systemctl start mongod.service
sudo service mongod start
sudo chkconfig mongod on

# Install nginx
sudo yum install -y epel-release
sudo yum install -y nginx
sudo yum install -y httpd

# Switch nginx or httpd
sudo systemctl start nginx
sudo systemctl enable nginx.service

# Install tomcat
sudo yum install -y tomcat