Skip to content

Instantly share code, notes, and snippets.

@wenzhixin
Last active November 15, 2017 09:30
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save wenzhixin/4650802f442d020cd332 to your computer and use it in GitHub Desktop.
Save wenzhixin/4650802f442d020cd332 to your computer and use it in GitHub Desktop.
redmine 3.0.2 installer on ubuntu 14.04(new installtion) with nginx, mysql and puma
# set cache proxy
sudo vi /etc/apt/apt.conf << EOT
Acquire::http::Proxy "http://192.168.88.10:3142";
Acquire::HTTP::Proxy::192.168.88.10 "DIRECT";
EOT
sudo apt-get update
sudo apt-get upgrade
# install ruby 2.2
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.2 ruby2.2-dev
# install redmine dependences
sudo apt-get install curl git subversion imagemagick libmagickwand-dev mysql-server mysql-client libmysqlclient-dev build-essential libssl-dev
# download redmine
mkdir www
cd www
wget http://www.redmine.org/releases/redmine-3.0.2.zip
unzip redmine-3.0.2.zip
mv redmine-3.0.2 redmine
cd redmine
# create database
mysql -uroot -ppassword
CREATE DATABASE redmine CHARACTER SET utf8;
exit
# config
cp config/configuration.yml.example config/configuration.yml
cp config/database.yml.example config/database.yml
vi config/database.yml << EOT
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "password"
encoding: utf8
EOT
# add puma
vi Gemfile << EOT
gem 'puma'
EOT
# gem, bundle
sudo gem install bundler
bundle install --without development test
# puma
mkdir tmp/pids
vi config/puma.rb << EOT
#!/usr/bin/env puma
environment 'production'
daemonize false
port 3030
pidfile 'tmp/pids/puma.pid'
state_path 'tmp/pids/puma.state'
threads 0, 16
bind 'unix://tmp/sockets/puma.sock'
activate_control_app 'unix://tmp/sockets/pumactl.sock'
EOT
sudo vi /etc/init/redmine.conf << EOT
description "redmine"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
setuid redmine
setgid redmine
respawn
script
exec /bin/bash << EOT
source /usr/local/rvm/scripts/rvm
rvm use 2.1.2 --default
cd /opt/redmine
bundle exec puma --config config/puma.rb
EOT
end script
EOT
sudo start redmine
@atilberk
Copy link

atilberk commented Aug 12, 2016

Thanks for the script, it helped me much. Few things:

You may want to let the user enter the mysql username and password.

More importantly, I belive this part of the script

mysql -uroot -ppassword
CREATE DATABASE redmine CHARACTER SET utf8;
exit

should be something like

mysql -uroot -ppassword << EOT
CREATE DATABASE redmine CHARACTER SET utf8;
exit
EOT

Also, I had error while running the script on a fresh Ubuntu 14.04 because unzip is not a known command. I believe you should check or directly address it.

@ashay-maheshwari
Copy link

Hello There !!!

Thanks for that effort.
I can see my redmine running. Where is the content of www is to be copied . Is it to be copied in /var/ to run behind apache ?

@denisgolius
Copy link

So where is nginx ?! You wrote nginx in header and not use int in manual or I' missed something?

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