Part 3: Install Redmine

CAUTION: This page contains time sensitive stuff, like static links to current versions of apps.
This is railroad baron Jay Gould, who probably rocked gems like none other. He might have even made you eat them.

I tried to follow the pre-packaged CentOS5 and CentOS + Apache install guides on the redmine wiki. They ended up being abysmal for me, who really hasn’t served a Rails app over Apache before.
I’m going to follow the Redmine Install page, and work on implementing everything from there.

We’ll be installing the latest stable release of Redmine: 1.3.1 (released February 6th, 2012)

Prerequisite installs

  • Rails 2.3.14 (no need to build and install already included in ../vendor/ directory of redmine build)
  • Ruby 1.8.7
  • RubyGems 1.3.7
  • Rake 0.8.7
  • Rack 1.1.1
  • I18n 0.4.2
  • RMagick
  • mysql and the mysql gem

Ruby install
Go to the ruby ftp, and grab the version that is compatible with the current redmine build:

tar zxvf ruby-1.8.7-p*.tar.gz
cd ruby-1.8.7-p*
make #safe to ignore the warnings
make install
which ruby
rm -f ~/ruby-1.8.7-p352.tar.gz
rm -f -r ~/ruby-1.8.7-p352

RubyGems install
As stated on the Redmine Install page, when using Rails 2.3.14, any rubygems version 1.7.0 or later will crash.

Find the last minor release before rubygems 1.7.0

tar zxvf rubygems-1.6.2.tgz
cd rubygems-1.6.2
ruby setup.rb # install gem
which gem
rm -f ~/rubygems-1.6.2.tgz
rm -f -r ~/rubygems-1.6.2

Install the Rake Gem

gem install rake --version '0.8.7'

Install the Rack Gem

gem install rack --version '1.1.1'

Install the I18n gem

gem install i18n --version '0.4.2'

Install the RDoc gem

gem install rdoc

Install the RMagick gem
There are stipulations on the version, but for now version 2.x.x is compatible with the Ruby version we’re installing

yum -y install ImageMagick-devel
gem install rmagick #ignoring errors for now

Install mysql and add it to the upstart db

yum -y install mysql mysql-server mysql-devel
chkconfig --level 345 mysqld on
service mysqld start

Install the mysql gem

gem install mysql

“Install” redmine files
Download the latest redmine version from the rubyforge site.

tar zxvf redmine-1.*.tar.gz
mkdir /var/www/redmine/ #this is for later, we'll be running with webrick for now
mv -f ./redmine-1*/* /var/www/redmine/
rm -r -f ./redmine-1.*
rm -f ./redmine-1.*.tar.gz

Configure mysql instance for redmine
Secure your mysql instance:

#enter for no root password
#Y to set root password
#enter a password
#Y to remove anonymous user
#Y to disallow root login remotely
#Y to remove test database and access to it
#Y to reload privilege tables now

Create redmine database and redmine user:

mysql -p
#then enter the password you created earlier for the root user
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'RANDOMPASSWORDFORMYSQLUSER';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
mysql> quit

Configure the Redmine Rails app

Configure the database connection

cp /var/www/redmine/config/database.yml.example /var/www/redmine/config/database.yml
vim /var/www/redmine/config/database.yml

Change the config with your database information:

  adapter: mysql
  database: redmine
  host: localhost
  port: 3306
  username: redmine
  encoding: utf8

Configure a session store secret

cd /var/www/redmine/
rake generate_session_store

Create the DB structure and default config into DB

cd /var/www/redmine/
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

Creating the redmine user and assigning permissions to the directories

useradd redmine
id redmine
cd /var/www/redmine/
mkdir tmp public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
#sudo chmod -R 755 files log tmp public/plugin_assets

Run redmine served over the webrick http server

su -c 'ruby script/server webrick -e production' redmine &

And we’re serving!

But we don’t want to serve so, kill -SIGINT $(pgrep ruby)

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: