Project

General

Profile

RedmineInstall » History » Version 72

András Iványi, 2009-12-08 12:41

1 1 Jean-Philippe Lang
h1. Installing Redmine
2
3
{{>TOC}}
4
5
h2. Requirements
6
7 25 Jean-Philippe Lang
h3. Operating system
8 1 Jean-Philippe Lang
9 68 Mischa The Evil
Redmine should run on most Unix, Linux, Mac and Windows systems as long as Ruby is available on this platform.
10 25 Jean-Philippe Lang
11
h3. Ruby & Ruby on Rails
12
13 30 Jean-Philippe Lang
The required Ruby and Ruby on Rails versions for a given Redmine version is:
14 25 Jean-Philippe Lang
15 30 Jean-Philippe Lang
|_. Redmine version|_. Supported Ruby versions|_. Required Rails version|
16 58 Eric Davis
|current trunk|ruby 1.8.6, 1.8.7|Rails 2.3.4|
17
|trunk from r2493 to r2886|ruby 1.8.6, 1.8.7|Rails 2.2.2|
18 32 Jean-Philippe Lang
|trunk before r2493|ruby 1.8.6, 1.8.7|Rails 2.1.2|
19 30 Jean-Philippe Lang
|0.8.x|ruby 1.8.6, 1.8.7|Rails 2.1.2|
20
|0.7.x|ruby 1.8.6|Rails 2.0.2|
21 22 Jean-Philippe Lang
22
Official releases include the appropriate Rails version in their @vendor@ directory. So no particular action is needed.
23 1 Jean-Philippe Lang
If you checkout the source from the Redmine repository, you can install a specific Rails version on your machine by running:
24
25 32 Jean-Philippe Lang
  gem install rails -v=2.2.2
26 25 Jean-Philippe Lang
27 28 Jean-Philippe Lang
Notes:
28 27 Jean-Philippe Lang
* RubyGems 1.3.1 is required
29 25 Jean-Philippe Lang
* Rake 0.8.3 is required
30 1 Jean-Philippe Lang
31 25 Jean-Philippe Lang
h3. Database
32
33 68 Mischa The Evil
* MySQL 4.1 or higher (recommended)
34 50 Mat Tipton
35 68 Mischa The Evil
 * make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running @gem install mysql@.
36
 * the Ruby MySQL gem currently does not support MySQL 5.1
37 35 Jean-Philippe Lang
38
* PostgreSQL 8
39
40
 * make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using: @ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";@
41 67 Jean-Philippe Lang
 * a bug in PostgreSQL 8.4.0 affects Redmine behaviour (#4259), this is fixed in PostgreSQL 8.4.1
42 72 András Iványi
 * make sure to install the PosgreSQL adapter for Ruby. You can get it by running @gem install postgres-pr@
43 35 Jean-Philippe Lang
44
* SQLite 3
45 26 Jean-Philippe Lang
46 25 Jean-Philippe Lang
h3. Optional components
47 23 Jean-Philippe Lang
48 25 Jean-Philippe Lang
      * SCM binaries (eg. @svn@), for repository browsing (must be available in your PATH). See [[RedmineRepositories]] for SCM compatibility and requirements.
49
      * "RMagick":http://rmagick.rubyforge.org/ (to enable Gantt export to png image)
50 56 Eric Davis
      * "Ruby OpenID Library":http://openidenabled.com/ruby-openid/ (to enable OpenID support) [only on Redmine trunk / 0.9-dev]  Version 2 or greater is required.
51 1 Jean-Philippe Lang
52 8 Thomas Lecavelier
h2. Installation
53 1 Jean-Philippe Lang
54 6 Jean-Philippe Lang
1. [[Download]] and extract the archive or [[CheckingoutRedmine|checkout]] Redmine.
55
56 36 Yclept Nemo
2. Create an empty database and accompanying user named @redmine@ for example.
57 6 Jean-Philippe Lang
58
For MySQL:
59 1 Jean-Philippe Lang
60 38 Yclept Nemo
<pre>
61 39 Yclept Nemo
create database redmine character set utf8;
62
create user 'redmine'@'localhost' identified by 'my_password';
63
grant all privileges on redmine.* to 'redmine'@'localhost';
64 38 Yclept Nemo
</pre>
65 1 Jean-Philippe Lang
66 63 Thanos Kyritsis
For PostgreSQL:
67
68
<pre>
69
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity';
70 64 Thanos Kyritsis
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
71 63 Thanos Kyritsis
</pre>
72
73 3 Jean-Philippe Lang
3. Copy @config/database.yml.example@ to @config/database.yml@ and edit this file in order to configure your database settings for "production" environment.
74 1 Jean-Philippe Lang
75 14 Jean-Philippe Lang
Example for a MySQL database:
76
77
<pre>
78
production:
79
  adapter: mysql
80
  database: redmine
81
  host: localhost
82 40 Yclept Nemo
  username: redmine
83
  password: my_password
84 3 Jean-Philippe Lang
</pre>
85
86 54 Barbara Post
If your server is not running on the standard port (3306), use this configuration instead:
87
88
<pre>
89
production:
90
  adapter: mysql
91
  database: redmine
92
  host: localhost
93
  port: 3307
94
  username: redmine
95
  password: my_password
96
</pre>
97
98
99
Example for a PostgreSQL database (default port):
100 44 Alexey Lustin
101
<pre>
102
production:
103
  adapter: postgresql
104
  database: <your_database_name>
105
  host: <postgres_host>
106
  username: <postgres_user>
107 46 Istvan DEMETER
  password: <postgres_user_password>
108 1 Jean-Philippe Lang
  encoding: utf8
109 44 Alexey Lustin
  schema_search_path: <database_schema> (default - public)
110
</pre>
111
112 68 Mischa The Evil
4. Generate a session store secret. This is required on the *trunk* version of Redmine at r2493 or above and the released 0.8.7 version or above.
113 1 Jean-Philippe Lang
114 48 Mat Tipton
Redmine stores session data in cookies by default, which requires a secret to be generated. This can be done by running:
115 41 Yclept Nemo
116 61 Ethan Fremen
   rake config/initializers/session_store.rb
117 41 Yclept Nemo
118
5. Create the database structure, by running the following command under the application root directory:
119
120 62 Vladimir L
  RAILS_ENV=production rake db:migrate
121 1 Jean-Philippe Lang
122
It will create tables and an administrator account.
123
124 41 Yclept Nemo
6. Insert default configuration data in database, by running the following command:
125 1 Jean-Philippe Lang
126 62 Vladimir L
  RAILS_ENV=production rake redmine:load_default_data
127 32 Jean-Philippe Lang
128
This step is optional but *highly recommended*, as you can define your own configuration from scratch. It will load default roles, trackers, statuses, workflows and enumerations.
129
130
7. Setting up permissions
131
132 14 Jean-Philippe Lang
NB: _Windows users have to skip this section._
133
134
The user who runs Redmine must have write permission on the following subdirectories: @files@, @log@, @tmp@ (create the last one if not present).
135
136
Assuming you run Redmine with a @redmine@ user:
137
138 31 Eric Davis
<pre>
139 1 Jean-Philippe Lang
mkdir tmp public/plugin_assets
140 31 Eric Davis
sudo chown -R redmine:redmine files log tmp public/plugin_assets
141 14 Jean-Philippe Lang
sudo chmod -R 755 files log tmp public/plugin_assets
142
</pre>
143 1 Jean-Philippe Lang
144 32 Jean-Philippe Lang
8. Test the installation by running WEBrick web server:
145 1 Jean-Philippe Lang
146 33 Jean-Philippe Lang
  ruby script/server webrick -e production
147 1 Jean-Philippe Lang
148 14 Jean-Philippe Lang
Once WEBrick has started, point your browser to http://localhost:3000/. You should now see the application welcome page.
149 1 Jean-Philippe Lang
150 32 Jean-Philippe Lang
9. Use default administrator account to log in:
151 1 Jean-Philippe Lang
152
    * login: admin
153 14 Jean-Philippe Lang
    * password: admin
154 1 Jean-Philippe Lang
155
You can go to @Admin & Settings@ to modify application settings.
156
157 21 Jean-Philippe Lang
h2. SMTP server Configuration
158
159
h3. 0.8.x releases
160
161 66 Henry Bernard
Copy @config/email.yml.example@ to @config/email.yml@ and edit this file to adjust your SMTP settings.
162 21 Jean-Philippe Lang
163 45 Cyber Sprocket
See the [[Email Configuration|email configuration]] examples.
164
165 1 Jean-Philippe Lang
h3. 0.7.x releases
166
167
In config/environment.rb, you can set parameters for your SMTP server:
168
169
    * config.action_mailer.smtp_settings: SMTP server configuration
170 7 Thomas Lecavelier
    * config.action_mailer.perform_deliveries: set to false to disable mail delivering
171 11 Jean-Philippe Lang
172
Don't forget to restart the application after any change.
173
174
h2. Backups
175
176
Redmine backups should include:
177
* data (stored in your redmine database)
178
* attachments (stored in the @files@ directory of your Redmine install)
179
180
Here is a simple shell script that can be used for daily backups (assuming you're using a mysql database):
181
182
<pre>
183
# Database
184 55 Lukasz Slonina
/usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz
185 11 Jean-Philippe Lang
186
# Attachments
187 1 Jean-Philippe Lang
rsync -a /path/to/redmine/files /path/to/backup/files
188
</pre>
189 69 Giuliano Simoncelli
190
h2. Notes on Windows installation
191
192
Get and install rubyinstaller from http://rubyforge.org. Form start menu select _Start Command Prompt with Ruby_
193
194
In the prompt follow the instruction given before
195
196
The commands:
197
198
<pre>
199
RAILS_ENV=production rake db:migrate
200
RAILS_ENV=production rake redmine:load_default_data
201
</pre>
202
203
has to be changed in 
204
205
<pre>
206
set RAILS_ENV=production
207
rake db:migrate
208 71 Giuliano Simoncelli
rake redmine:load_default_data
209 69 Giuliano Simoncelli
</pre>  
210
211 70 Giuliano Simoncelli
You may need to install install the mysql gem, with the command
212 69 Giuliano Simoncelli
213
<pre>
214
gem install mysql
215
</pre>
216
217
And in some case is required to copy the libmysql.dll file in your ruby/bin directory.
218
Not all libmysql.dll are ok this seem to works http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll