{{Stub|This wiki is under development, so it can contain errors or incomplete information. If you don't feel confident, please wait the wiki to be completed.}}

{{Stub|This wiki is under development, so it can contain errors or incomplete information. If you don't feel confident, please wait the wiki to be completed.}}

−

+

{{Merge|Redmine2 setup|Please check if there's something worth being merged here from [[Redmine2 setup]] and then just redirect it here.}}

Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.

Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.

Line 33:

Line 33:

</tr>

</tr>

<tr>

<tr>

−

<td rowspan="2">2.2.3</td>

+

<td rowspan="2">2.3.0</td>

−

<td>ruby 1.8.7, 1.9.2, 1.9.3</td>

+

<td>ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0</td>

−

<td rowspan="2">Rails 3.2.12</td>

+

<td rowspan="2">Rails 3.2.13</td>

<td rowspan="2">RubyGems <= 1.8</td>

<td rowspan="2">RubyGems <= 1.8</td>

</tr>

</tr>

<tr>

<tr>

−

<td>jruby-1.6.7</td>

+

<td>jruby 1.6.7, 1.7.2</td>

</tr>

</tr>

</table>

</table>

Line 49:

Line 49:

===Database===

===Database===

+

+

Redmine [http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Database Officially support many databases].

====MariaDB 5.0 or higher (recommended)====

====MariaDB 5.0 or higher (recommended)====

Line 54:

Line 56:

To install {{Pkg|mariadb}} simply refer to [[MariaDB]].

To install {{Pkg|mariadb}} simply refer to [[MariaDB]].

−

−

And make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running:

−

# gem install mysql2

====MySQL 5.0 or higher====

====MySQL 5.0 or higher====

To install {{Pkg|mysql}} simply refer to [[MySQL]].

To install {{Pkg|mysql}} simply refer to [[MySQL]].

−

−

And make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running:

−

# gem install mysql2

====PostgreSQL 8.2 or higher====

====PostgreSQL 8.2 or higher====

Line 74:

Line 70:

====Microsoft SQL Server====

====Microsoft SQL Server====

−

Support is planned for 2.3.0 release (but is already available on trunk for early adopters).

{{Note|Detailed build instructions at [[Arch User Repository#Build the package]]. It's '''HIGHLY''' recommended to read all the [[Arch User Repository|AUR]] page to understand what are you doing. }}

{{Note|Detailed build instructions at [[Arch User Repository#Build the package]]. It's '''HIGHLY''' recommended to read all the [[Arch User Repository|AUR]] page to understand what are you doing. }}

−

===Gems Installation===

+

===Database Configuration===

−

−

{{Note|If you prefer, you can install all the gems as pacman packages. You have only to search for the gem package and install them as usual. As of using Ruby gem is simpler to mange and maintain up to date gems, this will be preferable and used as default bellow.}}

Then you can install all the gems required by Redmine using the following command:

−

# cd /usr/share/webapps/redmine

−

# bundle install

−

−

To install without the ruby ''development'' and ''test'' environments use this instead of the last command:

−

# bundle install --without development test

−

−

To install only the gem of the database you are using (example, only using {{Pkg|mariadb}}), use this command instead:

−

# bundle install --without development test postgresql sqlite

−

−

{{Note|You can include/exclude environments and databases using the above syntax.}}

−

−

Although it is highly recommend to enjoy all the features of Redmine, if you really does not want to use {{Pkg|ImageMagick}}, you should skip the installation of the {{ic|rmagick}} gem using:

−

−

# bundle install --without rmagick

−

−

===Additional Gems===

−

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named {{ic|Gemfile.local}} at the root of your redmine directory. It will be loaded automatically when running bundle install:

−

−

{{hc|# nano Gemfile.local|

−

gem 'puma'}}

−

−

==Database Configuration==

Now, we will need to create the database that the Redmine will use to store your data. For now on, the database and its user will be named {{ic|redmine}}. But this names can be changed to anything else.

Now, we will need to create the database that the Redmine will use to store your data. For now on, the database and its user will be named {{ic|redmine}}. But this names can be changed to anything else.

{{Note|The configuration for [[MariaDB]] and [[MySQL]] will be the same since both are binary compatible.}}

{{Note|The configuration for [[MariaDB]] and [[MySQL]] will be the same since both are binary compatible.}}

+

+

====Database Creation====

To create the database, the user and set privileges (MariaDB and MySQL >= 5.0.2):

To create the database, the user and set privileges (MariaDB and MySQL >= 5.0.2):

−

{{bc|create database redmine character set utf8;

+

{{hc|# mysql -u root -p|

−

create user 'redmine'@'localhost' identified by 'my_password';

+

CREATE DATABASE redmine CHARACTER SET UTF8;

−

grant all privileges on redmine.* to 'redmine'@'localhost';}}

+

CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';

+

GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';}}

For versions of MariaDB and MySQL prior to 5.0.2:

For versions of MariaDB and MySQL prior to 5.0.2:

−

{{bc|create database redmine character set utf8;

+

{{hc|# mysql -u root -p|

−

grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';}}

+

CREATE DATABASE redmine CHARACTER SET UTF8;

+

GRANT ALL PRIVILEGES ON redmine.* TO'redmine'@'localhost' IDENTIFIED BY 'my_password';}}

{{Note|If you want to use additional environments, you must create separate databases for each one (for example: ''development'' and ''test'').}}

+

+

====Database Access Configuration====

Now you need to configure Redmine to access the database we just created. To do that you have to copy {{ic|/usr/share/webapps/redmine/config/database.yml.example}} to {{ic|database.yml}}:

Now you need to configure Redmine to access the database we just created. To do that you have to copy {{ic|/usr/share/webapps/redmine/config/database.yml.example}} to {{ic|database.yml}}:

Line 200:

Line 199:

schema_search_path: <database_schema> (default - public)}}

schema_search_path: <database_schema> (default - public)}}

−

==Session Store Secret Generation==

+

Example for a SQL Server database:

+

{{hc|nano database.yml|

+

production:

+

adapter: sqlserver

+

database: redmine

+

host: localhost '''#Set not default host (localhost) here, otherwise this line is unnecessary.'''

+

port: 1433 '''#Set not standard port (1433) here, otherwise this line is unnecessary.'''

+

username: redmine

+

password: my_password

+

}}

+

+

=== Ruby gems ===

+

Redmine requires some [https://wiki.archlinux.org/index.php/Ruby#RubyGems RubyGems] to be installed and there are multiple ways of installing them (as listed on the referenced page).

+

* prototype-rails

+

* unicorn (an application-server)

+

* mysql2 (high-performance Ruby bindings for MySQL)

+

* coderay

+

* erubis

+

* fastercsv

+

* rdoc

+

* net-ldap

+

* rack-openid

+

+

Obviously, if you choose a different database-server, or want to use a different application-server you should replace ''mysql2'' and ''unicorn'' to your liking.

+

+

===Adding Additional Gems (Optional)===

+

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named {{ic|Gemfile.local}} at the root of your redmine directory. It will be loaded automatically when running {{ic|bundle install}}:

+

+

{{hc|# nano Gemfile.local|

+

gem 'puma'}}

+

+

===Gems Installation===

+

+

{{Note|If you prefer, you can install all the gems as pacman packages. You have only to search for the gem package and install them as usual. As of using Ruby gem is much simpler to manage and maintain up to date gems, this will be preferable and used as default bellow.}}

Then you can install all the gems required by Redmine using the following command:

+

# cd /usr/share/webapps/redmine

+

# bundle install

+

+

To install without the ruby ''development'' and ''test'' environments use this instead of the last command:

+

# bundle install --without development test

+

+

{{Note|You can include/exclude environments using the above syntax.}}

+

+

Although it is highly recommend to enjoy all the features of Redmine, if you really does not want to use {{Pkg|ImageMagick}}, you should skip the installation of the {{ic|rmagick}} gem using:

+

+

# bundle install --without rmagick

+

+

{{Note|Only the gems that are needed by the adapters you've specified in your database configuration file are actually installed (eg. if your {{ic|config/database.yml}} uses the ''mysql2'' adapter, then only the mysql2 gem will be installed). Don't forget to re-run {{ic|bundle install}} when you change or add adapters in this file.}}

+

+

===Session Store Secret Generation===

Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:

Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:

Line 209:

Line 261:

{{Warning|Generating a new secret token invalidates all existing sessions after restart.}}

{{Warning|Generating a new secret token invalidates all existing sessions after restart.}}

−

==Database Structure Creation==

+

===Database Structure Creation===

With the database created and the access configured for Redmine, now it's time to create the database structure. This is done by running the following command under the application root directory:

With the database created and the access configured for Redmine, now it's time to create the database structure. This is done by running the following command under the application root directory:

Line 217:

Line 269:

These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

−

==Database Population with Default Data==

+

===Database Population with Default Data===

Now you may want to insert the default configuration data in database, like basic types of task, task states, groups, etc. To do so execute the following:

Now you may want to insert the default configuration data in database, like basic types of task, task states, groups, etc. To do so execute the following:

Line 228:

Line 280:

{{Note|This step is not mandatory, but it certainly will save you a lot of work to start using Redmine. And for a first time it can be very instructive.}}

{{Note|This step is not mandatory, but it certainly will save you a lot of work to start using Redmine. And for a first time it can be very instructive.}}

−

==Troubleshooting==

+

===File System Permissions===

+

The user account running the application '''must''' have write permission on the following subdirectories:

+

'''files''': storage of attachments.

+

'''log''': application log file production.log.

+

'''tmp''' and '''tmp/pdf''': used to generate PDF documents among other things (create these ones if not present).

+

Assuming you run the application with a the default Apache user {{ic|http}} account:

To test your new installation using WEBrick web server run the following in the Redmine folder:

−

===MySQL user and databases===

+

# ruby script/rails server webrick -e production

−

Create {{ic|redmine2}} user in MySQL server.

−

# mysql -u root -p

+

Once WEBrick has started, point your browser to '''http://localhost:3000/'''. You should now see the application welcome page. Use default administrator account to log in: '''''admin'''''/'''''admin'''''. You can go to Administration menu and choose Settings to modify most of the application settings.

−

CREATE USER 'redmine2'@'%' IDENTIFIED BY 'MY_PASSWORD';

−

GRANT USAGE ON *.* TO 'redmine2'@'%' IDENTIFIED BY 'MY_PASSWORD';

−

GRANT ALL PRIVILEGES ON `redmine2\_%`.* TO 'redmine2'@'%';

−

create database redmine2 character set utf8;

−

create database redmine2_production character set utf8;

−

create database redmine2_development character set utf8;

−

create database redmine2_test character set utf8;

+

{{Warning|Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.}}

{{Warning|The command above will delete ALL the gems in your system or user, depending of what type of Ruby installation you did in the prerequisites step. You must take care or you can stop working another applications that rely on Ruby gems.}}

−

autologin_cookie_name:

+

If you did the last step all remove all the gems, now you will need to reinstal them all:

−

autologin_cookie_path:

+

# gem install bundler

−

autologin_cookie_secure:

+

# bundle install --without development test

−

scm_subversion_command:

+

Copy the saved files:

−

scm_mercurial_command:

+

# cd /path/to/your/secure/location

−

scm_git_command:

+

# mv redmine_files.tar.gz /usr/share/webapps/redmine/files

−

scm_cvs_command:

+

# cd /usr/share/webapps/redmine/files

−

scm_bazaar_command:

+

# tar -zxpvf redmine_files.tar.gz

−

scm_darcs_command:

−

database_cipher_key:

+

Copy the installed plugins

+

# cd /path/to/your/secure/location

+

# mv redmine_plugins.tar.gz /usr/share/webapps/redmine/plugins

+

# cd /usr/share/webapps/redmine/plugins

+

# tar -zxpvf redmine_plugins.tar.gz

−

production:

+

Regenerate the secret token:

−

+

# cd /usr/share/webapps/redmine

−

development:

+

# rake generate_secret_token

−

</pre>

−

−

====Minimal database.yml====

−

For rapid reference. Remember to replace MY_PASSWORD for yours.

−

{{Note|1= Notice that adapter is mysql2 and not mysql.}}

+

Check for any themes that you may have installed in the {{ic|public/themes}} directory. You can copy them over but checking for updated version is ideal.

−

<pre>

+

{{Warning|Do NOT overwrite config/settings.yml with the old one.}}

−

production:

−

adapter: mysql2

−

database: redmine2_production

−

host: localhost

−

username: redmine2

−

password: MY_PASSWORD

−

encoding: utf8

−

development:

+

Update the database. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:

−

adapter: mysql2

+

# RAILS_ENV=production REDMINE_LANG=pt-BR rake db:migrate

−

database: redmine2_development

−

host: localhost

−

username: redmine2

−

password: MY_PASSWORD

−

encoding: utf8

−

test:

+

If you have installed any plugins, you should also run their database migrations:

Notes: This wiki is under development, so it can contain errors or incomplete information. If you don't feel confident, please wait the wiki to be completed. (Discuss in Talk:Redmine#)

This article or section is a candidate for merging with Redmine2 setup.

Notes: Please check if there's something worth being merged here from Redmine2 setup and then just redirect it here. (Discuss in Talk:Redmine#)

Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.

Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database.

Prerequisites

This document will guide you through the installation process of the Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and it's prerequisites separately, simply refering to the relevant sections below.

Although this guide will go through all the installation process, this isn't a one way path. So Redmine can use different versions of the other softwares (mariaDB, mySQL, postgreSQL, etc, as your database).

Note: At this time is important to note that this guide is an default suggestion, feel free to use other of the prerequisites mentioned on this wiki.

Ruby

Redmine version

Supported Ruby versions

Rails version used

Supported RubyGems versions

2.3.0

ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0

Rails 3.2.13

RubyGems <= 1.8

jruby 1.6.7, 1.7.2

There are two simple ways to install Ruby: installing the ruby package as described in ruby or installing RVM as described in RVM(recommended).

Note: If you use RVM, pay attention to the single and multiple user differences! If you are not creating a hosting service, the multiple user (available for all users on the machine) should be the choice for simpler debuging.

And then edit this file in order to configure your database settings for "production" environment (you can configure for the "development" and "test" environments too, just change the appropriate sections).

Ruby gems

Redmine requires some RubyGems to be installed and there are multiple ways of installing them (as listed on the referenced page).

prototype-rails

unicorn (an application-server)

mysql2 (high-performance Ruby bindings for MySQL)

coderay

erubis

fastercsv

rdoc

net-ldap

rack-openid

Obviously, if you choose a different database-server, or want to use a different application-server you should replace mysql2 and unicorn to your liking.

Adding Additional Gems (Optional)

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named Gemfile.local at the root of your redmine directory. It will be loaded automatically when running bundle install:

# nano Gemfile.local

gem 'puma'

Gems Installation

Note: If you prefer, you can install all the gems as pacman packages. You have only to search for the gem package and install them as usual. As of using Ruby gem is much simpler to manage and maintain up to date gems, this will be preferable and used as default bellow.

Then you can install all the gems required by Redmine using the following command:

# cd /usr/share/webapps/redmine
# bundle install

To install without the ruby development and test environments use this instead of the last command:

# bundle install --without development test

Note: You can include/exclude environments using the above syntax.

Although it is highly recommend to enjoy all the features of Redmine, if you really does not want to use ImageMagick, you should skip the installation of the rmagick gem using:

# bundle install --without rmagick

Note: Only the gems that are needed by the adapters you've specified in your database configuration file are actually installed (eg. if your config/database.yml uses the mysql2 adapter, then only the mysql2 gem will be installed). Don't forget to re-run bundle install when you change or add adapters in this file.

Session Store Secret Generation

Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:

# rake generate_secret_token

Note: For Redmine prior to 2.x this step is done by executing # rake generate_session_store.

Warning: Generating a new secret token invalidates all existing sessions after restart.

Database Structure Creation

With the database created and the access configured for Redmine, now it's time to create the database structure. This is done by running the following command under the application root directory:

These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

Database Population with Default Data

Now you may want to insert the default configuration data in database, like basic types of task, task states, groups, etc. To do so execute the following:

# RAILS_ENV=production rake redmine:load_default_data

Redmine will prompt for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task:

Test the installation

To test your new installation using WEBrick web server run the following in the Redmine folder:

# ruby script/rails server webrick -e production

Once WEBrick has started, point your browser to http://localhost:3000/. You should now see the application welcome page. Use default administrator account to log in: admin/admin. You can go to Administration menu and choose Settings to modify most of the application settings.

Warning: Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.

Warning: The command above will delete ALL the gems in your system or user, depending of what type of Ruby installation you did in the prerequisites step. You must take care or you can stop working another applications that rely on Ruby gems.

If you did the last step all remove all the gems, now you will need to reinstal them all: