Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jenkins setup for Rails on EC2
Based on these:
Setup an EC2 instance with Ubuntu (14.04)
Open port 8080
Install Jenkins
wget -q -O - | sudo apt-key add -
sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
http://<host>:8080 -> you should see Jenkns running.
Setup nginx on port 80
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default ../sites-enabled/default
Copy & save into /etc/nginx/sites-available/jenkins:
# Configuration for nginx
upstream app_server {
server fail_timeout=0;
server {
listen 80;
listen [::]:80 default ipv6only=on;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
# End nginx configuration
sudo ln -s /etc/nginx/sites-available/jenkins /etc/nginx/sites-enabled/
sudo service nginx restart
Open port 80 in the security group and close 8080.
TODO: put basic auth instructions in here
Setup Ruby/Rails
sudo apt-get install build-essential git-core libxml2 libxslt-dev libxml2-dev
sudo apt-get install curl
# Add the "jenkins" user to the sudo group
usermod -a -G sudo jenkins
sudo su jenkins
sudo passwd jenkins -> set a password
sudo curl -L | bash -s stable --ruby
sudo apt-get install libmysqlclient-dev ruby-dev
# For MySQL 5.5
sudo apt-get install mysql-client mysql-server ruby-mysql libmysqlclient-dev
# For MySQL 5.1
# Download the tarball and follow the instructions
sudo groupadd mysql
sudo useradd -r -g mysql mysql
cd /usr/local
sudo tar zxvf /path/to/mysql-VERSION-OS.tar.gz
sudo ln -s full-path-to-mysql-VERSION-OS mysql
cd mysql
sudo chown -R mysql .
sudo chgrp -R mysql .
sudo scripts/mysql_install_db --user=mysql
sudo chown -R root .
sudo chown -R mysql data
sudo cp support-files/my-medium.cnf /etc/my.cnf
sudo bin/mysqld_safe --user=mysql &
sudo cp support-files/mysql.server /etc/init.d/mysql.server
# For Postgres
sudo aptitude install libpq-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-client
# For MongoDB
sudo apt-key adv --keyserver --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install mongodb-10gen
# Plugins
Github OAuth
All Changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.