Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2012 11:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Setup Jenkins with RVM on Centos 5.6

Make sure server is updated

yum update

Install prerequisites

yum install gcc automake autoconf libtool make patch java httpd ruby ruby-devel readline-devel zlib-devel

Add jenkins repo and install

wget -O /etc/yum.repos.d/jenkins.repo
rpm --import
yum install jenkins

Start jenkins and make sure it starts on boot

chkconfig jenkins on
service jenkins start

Jenkins runs on port 8080, so setup Apache to proxy port 80 to Jenkins. Create /etc/httpd/conf.d/jenkins.conf with the following content:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerAlias ci
    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/

Now start Apache and make sure it starts on boot

chkconfig on
service https restart

Modify jenkins user to allow login so we can install RVM

usermod -m /var/lib/jenkins -s /bin/bash jenkins

Login as jenkins and install RVM

su - jenkins
mkdir -p ~/.rvm/src
cd ~/.rvm/src
git clone git://
cd rvm

Don't forget to add the required line to ~/.bash_profile

if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi

Install require RVM packages

rvm pkg install readline
rvm pkg install zlib

Install main rubies

rvm install 1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment