-
-
Save kevinold/216077 to your computer and use it in GitHub Desktop.
CentOS 5.3 VPS Setup Shell Script
This file contains hidden or 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 | |
# You must run as root!!! (or sudo) | |
##################### | |
##### IMPORTANT ##### | |
##################### | |
# Add the following entry to /etc/yum.repos.d/rubyworks.repo: | |
# | |
# [rubyworks] | |
# name=RubyWorks | |
# baseurl=http://rubyworks.rubyforge.org/redhat/$releasever/RPMS/$basearch | |
# enabled=1 | |
# gpgcheck=1 | |
# gpgkey=http://rubyworks.rubyforge.org/RubyWorks.GPG.key | |
# priority=1 | |
/bin/cat << EOM | |
########################################################################### | |
##### RUNNING UPDATE ##### | |
########################################################################### | |
EOM | |
yum update -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING DEVELOPMENT TOOLS ##### | |
########################################################################### | |
EOM | |
yum groupinstall 'Development Tools' -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING APACHE ##### | |
########################################################################### | |
EOM | |
yum install httpd mod_ssl -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING MYSQL ##### | |
########################################################################### | |
EOM | |
yum --enablerepo=rubyworks install mysql-server mysql mysql-devel mysql-ruby -y | |
/bin/cat << EOM | |
########################################################################### | |
##### SET APACHE AND MYSQL TO START ON BOOT ##### | |
########################################################################### | |
EOM | |
/sbin/chkconfig httpd on | |
/sbin/chkconfig --add mysqld | |
/sbin/chkconfig mysqld on | |
/bin/cat << EOM | |
########################################################################### | |
##### STARTING APACHE ##### | |
########################################################################### | |
EOM | |
/sbin/service httpd start | |
/bin/cat << EOM | |
########################################################################### | |
##### STARTING MYSQL ##### | |
########################################################################### | |
EOM | |
/sbin/service mysqld start | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING POSTFIX AND SUBVERSION ##### | |
########################################################################### | |
EOM | |
yum install postfix subversion -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING GIT AND DEPENDENCIES ##### | |
########################################################################### | |
EOM | |
yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel -y | |
wget http://kernel.org/pub/software/scm/git/git-1.6.4.2.tar.gz | |
tar zxvf git-1.6.4.2.tar.gz | |
cd git-1.6.4.2 | |
make prefix=/usr/local all | |
make prefix=/usr/local install | |
cd .. | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING RUBY ##### | |
########################################################################### | |
EOM | |
yum install --enablerepo=rubyworks ruby ruby-devel ruby-irb ruby-rdoc ruby-ri -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING IMAGEMAGICK AND DEPENDENCIES ##### | |
########################################################################### | |
EOM | |
yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel -y | |
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz | |
tar zxvf ImageMagick.tar.gz | |
cd ImageMagick-* | |
./configure --prefix=/usr --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes | |
make clean | |
make | |
make install | |
cd .. | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING RUBYGEMS ##### | |
########################################################################### | |
EOM | |
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz | |
tar xvzf rubygems-1.3.4.tgz | |
cd rubygems-1.3.4 | |
ruby setup.rb | |
cd .. | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING RAILS ##### | |
########################################################################### | |
EOM | |
gem install rails --no-rdoc --no-ri | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING RMAGICK GEM ##### | |
########################################################################### | |
EOM | |
gem install rmagick --no-rdoc --no-ri | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING MYSQL GEM ##### | |
########################################################################### | |
EOM | |
gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --no-rdoc --no-ri | |
/bin/cat << EOM | |
########################################################################### | |
##### PASSENGER DEPENDENCIES ##### | |
########################################################################### | |
EOM | |
yum install httpd-devel apr-devel -y | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING PASSENGER GEM ##### | |
########################################################################### | |
EOM | |
gem install passenger --no-ri --no-rdoc | |
/bin/cat << EOM | |
########################################################################### | |
##### INSTALLING PASSENGER APACHE MODULE ##### | |
########################################################################### | |
EOM | |
passenger-install-apache2-module --auto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment