Categories
Management MySQL Project Management Server Configuration

Installing Redmine 2.3.3 on Ubuntu 13

Okay, today I install Redmine on Azure hosted Ubuntu 13.04. The steps are easy once I get it done after 2 days of working and finding what is right to do. So, let us start on installation, but a little history first.

I see that Bitnami has put quite a few Redmine VM Images on VM depot. But unfortunately all are on older version of Ubuntu. But I still thought I can upgrade them for my use, so I use the latest [Ubuntu 12] based image and try to do ‘do-release-upgrade’ it download lot of things, but in end it fail to update the machine. So, I now opt to use core Linux machine to install what I need. So, I create a VM using Ubuntu 13.04. It was easy as usual. Once the machine is up. I once run do-release-upgrade to install all latest package and there are quite a lot of them. It took around 20-30 minute for my Very small instance of VM to install them.

Once the machine is ready, now we need to install: Apache, MySQL [so I can host not just redmine but couple of my other website as well]. And to extract the latest source of Redmine we also need SVN [package name ‘subversion’] on server as well. I usually use svn version only, but you can download zip/tarball as well.

So install is as follow:

# sudo apt-get install subversion
# sudo apt-get install apache2 libapache2-mod-passenger
# sudo apt-get install mysql-server mysql-client
# sudo apt-get install ruby ruby-dev
# sudo apt-get install imagemagick libmagickwand-dev ruby-rmagick

Above statements will install subversion, apache, MySQL, ruby and ruby-dev, imagemagick and ruby-rmagick .. they all are prerequesties and you might already gave those. Once this is done..

Download Redmine 2.3.3 from svn using this Redmine Download link http://www.redmine.org/projects/redmine/wiki/Download

#svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine-2.5

Now, we need GEM Bundler to be installed. so

 # sudo gem install bundler

Now navigate to Redmine folder, oh you can download redmine in any folder, as long as you are ready to use your <redmine folder>/public as your document root. if not you can use symbolic link of public folder as well in apache. Just thought to tell this now. In next step we will create a Gemfile.local to tell the installer to use rack’ version 1.4.5 as by default it install version 1.5.2 and it doesn’t work for me and I see lot of people had problem with it, so just create a Gemfile.local with one line in it and use your bundler install to do it.

# cd redmine-2.3 
# sudo cat > Gemfile.local << "EOF"
gem "rack", "~> 1.4.5"
EOF
# sudo bundle install --without development test mysql
# rake generate_secret_token

Once you did that it install redmine or rather just built it. We now need a database to store redmine data, so create MySQL database, username and password as you want. Obviously you don’t want to use root username. Once you create that user and database. then go to redmine/config folder, you will find database.yml.example file, copy it as database.yml go to production section of MySQL db, enter your login info and change database type t0 mysql2 [it is just new library of MySQL with ruby, you can still use [mysql] but it might give error so better change it.

production:
  adapter: mysql2
  database: redmine_default
  host: localhost
  username: redmine
  password: some-secure-plain-text-password
  encoding: utf8

Now run following commant to Create Database Table, clear unwanted data and session

rake db:migrate RAILS_ENV=production 
rake tmp:cache:clear
rake tmp:sessions:clear

Now, second last step: Creating a virtual Host or defining the DocumentRoot so our apache can use redmine installation. Add following Virtual Host Tag, you can add other information as you like, but keep this as minimum you need. Please change “[” and “]” with “<” and “>” as my editor doesn’t allow me to use them below…

[Virtualhost *:80]
DocumentRoot /usr/local/share/redmine-2.3.0/public
[Directory /usr/local/share/redmine-2.3.0/public]
AllowOverride all
Options -MultiViews
[/Directory]
[/VirtualHost]

Restart Apache

# sudo service apache2 restart

Now, go to your domain, IP address base url whaterver it is, and login using “admin” as username and password. You are most probably ready to rock. If not you should enable error login using /config/environment/production.rb file and then check what error you might get from Redmine.