Segfault > IT > Webserver > Redmine

Installing the Redmine bugtracker on Gentoo

(31.Oct.2011)


Introduction

I wanted a bugtracker for my (inexisting) applications.
On one side it helps me to keep track of the problems I am aware of and on the other side of what I still have to do.
Additionally, I thought that it would be great if (inexisting) users would be able to post their own bugs or the features that they wished , so that the app would become a killer-app(lication!) and I would be able to take over the world more quickly.
I therefore started looking around for a software that would provide these functionalities.

Had a look around and the ones I saw were either too simple or too complicated - e.g. when I tried to use "Bugzilla" some years ago to post my first bug for Gentoo I started thinking that some of the people that programmed these apps are most probably IT-narcissists or that at least they try very hard to discourage people from submitting bugs.

With my scope in mind - find something happy and simple - I went through the apps I saw and in the end Redmine was the one that provided what I needed without making things too complicated.

To be honest, I don't know Ruby nor Ruby on Rails and I personally think that it's a pity that such an app does not exist for the PHP realm, but in the end it's still better than Java and especially Perl. (don't like Java because it uses a lot of memory - pro-Java people, you can tell me what you want but that's how things are for somebody that does not know every Java-trick. Dont like Perl because I don't like its syntax and the apps are usually overly-complicated in their configuration, their life-expectancy & quality is lower than the ones written for PHP and each time that I upgrade Perl I have to recompile all the apps/libs/etc... to make sure that the dependencies aren't broken).

This is how I installed Redmine to use a SQLite3 database on a Gentoo server (installation will be different if you're using other distros like Fedora, CentOS or Ubuntu - but you might still need some of the details mentioned here) - I do have MySQL installed but because of it being now property of Oracle (therefore with the chance that its open-source availability will be dropped in the future or that its development will artificially be limited to avoid interferences with the commercially most used DB in the world) I tend to prefer other solutions if the requirements aren't too demanding (btw., I still have to have a look at PostgreSQL).


Installation

  • emerge redmine
    The current version in my case is 1.2.1-r1.

    In my case the packages that had to be unmasked were:
    =www-apps/redmine-1.2.1-r1
    =dev-ruby/coderay-0.9.7
    =dev-ruby/ruby-net-ldap-0.0.4-r1

    The use-flags I used were:
    www-apps/redmine sqlite3 imagemagick -fastcgi -mysql -openid -passenger -postgres -test
    dev-ruby/activerecord sqlite3
  • Created in /var/www/localhost/htdocs a symlink - just to remember where redmine is installed and how the hostname of Apache's vhost is called:
    bugtracker -> /var/lib/redmine/
  • Created a separate directory where to store Redmine-related stuff, like the DB (as I'm not using MySQL but SQLite).
    mkdir /home/redmine_bugtracker
    mkdir /home/redmine_bugtracker/attachments
    mkdir /home/redmine_bugtracker/db
    chown -R redmine:redmine /home/redmine_bugtracker
  • Database:
    Went to...
    cd /var/lib/redmine/config/
    ...and prepared the DB-config file:
    cp -iv database.yml.example database.yml

    Changed in there the following:
    #MYCUSTOM-commented original settings
    #production:
    #  adapter: mysql
    #  database: redmine
    #  host: localhost
    #  username: root
    #  password:
    #  encoding: utf8
    #MYCUSTOM-my DB settings to use sqlite
    production:
      adapter: sqlite3
      database: /home/redmine_bugtracker/db/redminedb.sqlite3
  • In the same directory, prepared the normal config file:
    cp -iv configuration.yml.example configuration.yml

    These are all the lines that in my case are uncommented (not sure if it's stupid to mention to change the informations that I wrote in capital letters, but in any case now you know):
    default:
      email_delivery:
        delivery_method: :smtp
        smtp_settings:
          address: SMTP.YOUR_SERVER.COM
          port: 25
          domain: YOUR_SERVER.COM
          authentication: :login
          user_name: "SERVER@YOUR_SERVER.COM"
          password: "SET HERE THE PASSWORD"
      attachments_storage_path: /home/redmine_bugtracker/attachments
      autologin_cookie_name:
      autologin_cookie_path:
      autologin_cookie_secure:
      scm_subversion_command:
      scm_mercurial_command:
      scm_git_command:
      scm_cvs_command:
      scm_bazaar_command:
      scm_darcs_command:
      database_cipher_key:
    production:
    development:
  • Again in the same directory have a look at the file "settings.yml". For the time being the only thing I changed in there was:
    host_name:
      default: bugtracker.YOUR_SERVER.COM
  • Go to the root directory of Redmine...
    cd /var/lib/redmine
    ...and generate the session store (no clue what it does where):
    rake generate_session_store
  • Now check with...
    gem list
    ...if you have a sqlite3 extension installed - if yes you'll see an entry similar to this one (the line mentioning "sqlite3"):
    *** LOCAL GEMS ***
    actionmailer (2.3.11)
    actionpack (2.3.11)
    activerecord (2.3.11)
    activeresource (2.3.11)
    activesupport (2.3.11)
    builder (2.1.2)
    coderay (0.9.7)
    hoe (2.8.0)
    i18n (0.4.2)
    mysql (2.8.2)
    racc (1.4.6)
    rack (1.1.0)
    rails (2.3.11)
    rake (0.8.7)
    rake-compiler (0.7.5)
    rmagick (2.13.0)
    ruby-net-ldap (0.0.4)
    sqlite3-ruby (1.3.2)

    text-format (1.0.0)
    text-hyphen (1.0.0)
    tmail (1.2.7.1)
    tzinfo (0.3.27)

    If you don't see it, install it:
    emerge sqlite3-ruby
  • Still in the same directory run the scripts to prepare the DB schemas...
    RAILS_ENV=production rake db:migrate
    ...(you should now see the file containing the DB in the directory "/home/redmine_bugtracker/db") and then run the script to load the default data into the DB:
    RAILS_ENV=production rake redmine:load_default_data

    Before forgetting, change the owner of the DB-file that was just created:
    chown redmine:redmine /home/redmine_bugtracker/db/redminedb.sqlite3
  • Go to /var/lib and change the ownership of the log directory:
    chown -R redmine:redmine redmine/
  • No changes done to /etc/conf.d/redmine:
    # /etc/conf.d/redmine: config file for /etc/init.d/redmine
    # Bind to specified address
    # You can set to 0.0.0.0 to accept requests anywhere
    #REDMINE_ADDRESS="localhost"
    # Port
    #REDMINE_PORT=3000
    # RAILS_ENV
    #RAILS_ENV=production
    # additional opts
    #REDMINE_OPTS=""
  • You can now sign-in. The initial UserID and password are both "admin" and you should change them immediately.
  • After having started Redmine change if needed the owner of the (log directory) and file:
    chown -R redmine:redmine /var/log/redmine/
  • If you're using httpS to access Redmine through Apache you'll have to add the following to your Apache vhost config:
    ...
    ProxyRequests Off
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    #Specific for Redmine - otherwise when saving changes I get redirected to http instead of https.
    RequestHeader set X_FORWARDED_PROTO 'https'

    ...
  • Theme installation
    The Red-Andy theme is very nice (see link below).

    Download it and put the "red-andy" directory below "/var/lib/redmine/public/themes/" and then change again the owner of the new files:
    chown -R redmine:redmine /var/lib/redmine/public/themes/red-andy/
    In Redmine go to "Administration => Settings => Display" and select "Red-andy" as theme.
  • This is how it looks like once it's installed.

References