Redmine is an excellent project management tool written using Ruby on Rails. It provides everything you need to organise your workplace or personal projects. Once you see it working you definitely will want to use it on your own projects. Everything is great until you want to install it since redmine only works with very specific versions of its dependencies. There are many steps that you need to take into consideration, even if you install the outdated version in the repositories. In this guide, I will show you how to install redmine 1.1.2 (the latest version at the time of writing) on Ubuntu Server 10.04 32 bits (latest LTS version at the time of writing).
Make sure that you installed Ubuntu Server 10.04 with SSH (optional) and LAMP support. Both can be selected to be automatically installed at the end of the normal Ubuntu Server 10.04 installation. Once it is installed, remember to update and upgrade your system.
sudo apt-get update sudo apt-get upgrade
First, let’s install some dependencies:
sudo apt-get install ruby1.8-dev rubygems1.8 libmysql-ruby libmysqlclient-dev rake libopenssl-ruby libapache2-mod-passenger imagemagick libmagickcore-dev libmagickwand-dev
Now we can install the required packages for ruby, or gems. Note that some packages will take a long time to install and provide no output, so just be patient. Also, you will see some warnings like No definition for X. Ignore those, they mean that some documentation was not installed, and we can live with that.
sudo gem install rails -v=2.3.5 sudo gem install mysql sudo gem install ruby-openid sudo gem install i18n -v=0.4.2 sudo gem install passenger sudo gem install rmagick
Now we have to prepare the database. Enter the MySQL console as root:
mysql -uroot -p
Provide the root password. This is the password you set in the early LAMP installation. Now, inside the MySQL console, execute these commands:
create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'myPassword'; grant all privileges on redmine.* to 'redmine'@'localhost'; exit
Remember to change myPassword with your actual password. This is the one that will be used for the user redmine in the database redmine at localhost.
Now it is time to get the redmine code. Execute the following commands to get redmine 1.1.2.
cd ~ wget http://rubyforge.org/frs/download.php/74419/redmine-1.1.2.tar.gz tar -xvzf redmine-1.1.2.tar.gz cd redmine-1.1.2
Now setup the database configuration file to match our current environment:
cp config/database.yml.example config/database.yml nano config/database.yml
Put the details of the database on the specific fields, in particular username and password. Username should be redmine and password should be myPassword or the one you provided before. Make sure that you change both, production and development sections. When you are finished, just hold Control and then press X. This is the command for exiting nano. It will ask if you want to save the changes, just press y (as in yes) and hit enter. That’s it, file saved and back to the console.
Now do the same for configuring email:
cp config/email.yml.example config/email.yml nano config/email.yml
For this example, we are going to use gmail, but you can use any email settings that you need. Make sure that address is smtp.gmail.com, port is changed to 587, domain is set to gmail.com (or your host if you use google apps) and that the user_name and password are your credentials. Also, make sure that you add a tls: true line. And finally, the most important part, is that you change login with plain in authentication.
production: delivery_method: :smtp smtp_settings: address: smtp.gmail.com port: 587 tls: true domain: gmail.com # or your domain authentication: :plain user_name: fancyUsername@gmail.com # or your domain password: secretPassword
For gmail to work, we need to install a script. Let’s get it:
sudo apt-get install git-core ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git
Let’s proceed with the installation:
rake generate_session_store sudo mkdir /opt/redmine cd /opt/redmine sudo cp -r ~/redmine-1.1.2 . cd redmine-1.1.2 sudo RAILS_ENV=production rake db:migrate sudo RAILS_ENV=production rake redmine:load_default_data
Press enter to accept the default language (English) and then execute the following:
sudo chown -R www-data:www-data files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets sudo nano /etc/apache2/mods-available/passenger.conf
Add this line inside the <IfModule mod_passenger.c> tag:
Now let’s configure apache:
sudo nano /etc/apache2/sites-available/default
Just before the closing tag, </VirtualHost>, add the following:
RailsEnv production RailsBaseURI /redmine
Now we put a link to our application to be accessible from apache and restart it:
sudo ln -s /opt/redmine/redmine-1.1.2/public /var/www/redmine sudo /etc/init.d/apache2 restart
Some clean up…
cd ~ rm -r redmine-1.1.2 rm redmine-1.1.2.tar.gz
The installation process is finished. Open a web browser in another computer and go to yourServerIP/redmine and you should see the initial page of redmine. If it does not show, then something is wrong in your installation. Go back and carefully follow the steps from the beginning. If you do not know your IP address, just run ifconfig from the server.
Click on Sign-in. Enter admin for user and password. Now you are logged in as the redmine administrator. Go to Administration and then click on Information. You should see the following:
Note that Redmine 1.1.2 stable is installed correctly with RMagick and the directories that it needs are writeable. The only thing left to do here is to change the details of the administrator account (that is why there is one error sign), and start creating users and projects and manage them with this great tool. Once you change your administrator account, you should see no errors on the information page:
And now you can enjoy all the features of this great project manager: Gantt charts, Roadmaps, wiki, file repositories, multiple project support, forums, and much more…