Project

General

Profile

HowTo install Redmine on CentOS 5 » History » Version 32

Nick Shel, 2012-03-05 11:20

1 27 Yu Kobayashi
h1. HowTo install Redmine on CentOS 5 or 6
2 1 Serafim J Fagundes
3 3 Mischa The Evil
{{>toc}}
4
5 31 Nick Shel
h2. Introduction
6 32 Nick Shel
7 31 Nick Shel
CentOS is one of the most frequently chosen Linux operating systems for Linux based production environments. There is extensive documentation available on setting up CentOS and it is arguably the best choice for deploying and running production Linux servers for organisation with all levels of in-house Linux server deployment and administration capability.
8
9
Redmine is one of the best (if not THE best) open source issue tracking and project management applications, but because it is developed using Ruby on Rails it can be rather complex to deploy for anyone not familiar with the Ruby on Rails environment.
10
11
This How-To provides detailed steps required to get Redmine up and running on a CentOS operating system using the following components:
12
* Apache web server
13
* MySQL database management system
14
* Ruby on Rails
15
16
The How-To provides detailed instructions on the installation and explains what each step does, so that it can be easily follows by people experienced and new to the Ruby on Rails environment.
17
18 3 Mischa The Evil
h2. Assumptions
19
20 31 Nick Shel
* CentOS is installed and works
21 30 Nick Shel
* Apache is installed and works 
22
* MySQL is installed and works
23 1 Serafim J Fagundes
* Your are logged as root
24
* The next steps are done successively without errors
25
26 3 Mischa The Evil
h2. Steps to take
27
28 6 Gary Wilson
h3. Install gem and passenger dependencies
29
30
<pre>
31 14 Erwin Baeyens
yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel
32 6 Gary Wilson
</pre>
33
34 1 Serafim J Fagundes
h3. Get Ruby
35
36 3 Mischa The Evil
<pre>
37 28 Nick Shel
# Create the directory where you will store the Downloads
38
mkdir ~/Downloads # This can be any directory.
39
40
# Change to directory where you will store the download
41
cd ~/Downloads # This can be any directory.
42
43
# FTP to where you will download ruby from.
44
# When asked to login use user/password of anonymous/anonymous
45
ftp ftp.ruby-lang.org 
46
Name (ftp.ruby-lang.org:root): anonymous
47
Password: anonymous
48
49
ftp> cd /pub/ruby
50
ftp> get ruby-1.8.7-pXXX.tar.gz
51
ftp> quit
52
53
# You have now downloaded ruby and need to untar it
54
tar zxvf ruby-1.8.7-pXXX.tar.gz
55
56
# Compile ruby
57
cd ruby-1.8.7-pXXX
58 17 Johannes M.
./configure
59 1 Serafim J Fagundes
make
60
make install
61 28 Nick Shel
62
# Verify ruby installation
63 1 Serafim J Fagundes
ruby -v
64
which ruby
65 28 Nick Shel
66
# Change back into your downloads directory
67 1 Serafim J Fagundes
cd ..
68 3 Mischa The Evil
</pre>
69 1 Serafim J Fagundes
70 18 Johannes M.
h3. Get Gems 1.4.2 (does not work with Gems 1.5)
71 1 Serafim J Fagundes
72 3 Mischa The Evil
<pre>
73 18 Johannes M.
wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz
74 19 Johannes M.
tar zxvf rubygems-1.4.2.tgz
75 18 Johannes M.
cd rubygems-1.4.2
76 1 Serafim J Fagundes
ruby setup.rb
77
gem -v
78
which gem
79
cd ..
80 3 Mischa The Evil
</pre>
81 1 Serafim J Fagundes
82 26 Anonymous
h3. Install Passenger (requires gcc)
83 1 Serafim J Fagundes
84 3 Mischa The Evil
<pre>
85
gem install passenger
86 1 Serafim J Fagundes
passenger-install-apache2-module
87
</pre>
88
89 26 Anonymous
An alternate method is to install mod_passenger RPM for Apache from the following location: 
90
http://passenger.stealthymonkeys.com/
91
92
RHEL/CentOS 5
93
<pre>
94
rpm -Uvh http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm
95
yum install mod_passenger
96
</pre>
97
98
RHEL/CentOS 6
99
<pre>
100
rpm --import http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc
101
yum install http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm
102
yum install mod_passenger
103
</pre>
104
105 8 Erwin Baeyens
h3. Restart Apache
106 1 Serafim J Fagundes
107
<pre>service httpd restart</pre>
108 3 Mischa The Evil
109 1 Serafim J Fagundes
h3. Download Redmine
110
111 26 Anonymous
Download page: http://rubyforge.org/frs/?group_id=1850
112
113 16 Steven Verbeek
<pre>
114 26 Anonymous
wget http://rubyforge.org/frs/download.php/75597/redmine-1.3.0.tar.gz  # GET LATEST VERSION ON RUBYFORGE
115
tar zxvf redmine-1.3.0.tar.gz
116 1 Serafim J Fagundes
</pre>
117
118
h3. Copy the folder to its HTTP document root folder
119 16 Steven Verbeek
120 26 Anonymous
<pre>cp -av redmine-1.3.0/* /var/www/redmine</pre>
121 1 Serafim J Fagundes
122
h3. Configure Apache to host the documents
123 10 Erwin Baeyens
124
more information can be found here: [[HowTo configure Apache to run Redmine]]
125 1 Serafim J Fagundes
126
h3. Install Bundler
127 4 Neil McFarlane
128 1 Serafim J Fagundes
<pre>gem install bundler</pre>
129
130
h3. Add the Bundler Boot and preinitializer code
131 3 Mischa The Evil
132 1 Serafim J Fagundes
For more info go to the "Bundler site":http://gembundler.com/.
133
134
h3. Create the Gemfile and register these gems in it
135 22 Johannes M.
136 8 Erwin Baeyens
<pre>vi /var/www/redmine/Gemfile</pre>
137 20 Johannes M.
138 22 Johannes M.
<pre>
139 20 Johannes M.
# file: /var/www/redmine/Gemfile
140 21 Johannes M.
source "http://rubygems.org"
141
gem "rake", "0.8.3"
142
gem "rack", "1.1.0"
143
gem "i18n", "0.4.2"
144
gem "rubytree", "0.5.2", :require => "tree"
145
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
146
gem "mysql"
147 20 Johannes M.
gem "coderay", "~>0.9.7"
148 1 Serafim J Fagundes
</pre>
149 3 Mischa The Evil
150 1 Serafim J Fagundes
<pre>bundle install</pre>
151
152
h3. Create the Redmine MySQL database
153 23 Johannes M.
154
<pre>
155
yum install mysql-server
156
chkconfig mysqld on
157
service mysqld start
158
/usr/bin/mysql_secure_installation
159
</pre>
160 1 Serafim J Fagundes
161 23 Johannes M.
> For MySQL:
162 11 Erwin Baeyens
> start the mysql client (@mysql -u root -p@) and enter the following commands
163
> > <pre>create database redmine character set utf8;
164
create user 'redmine'@'localhost' identified by 'my_password';
165 10 Erwin Baeyens
grant all privileges on redmine.* to 'redmine'@'localhost'; </pre>
166 11 Erwin Baeyens
167
> For versions of MySQL prior to 5.0.2 - skip the 'create user' step and instead:
168
169 9 Erwin Baeyens
> > <pre> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';</pre>
170 24 Johannes M.
171 1 Serafim J Fagundes
h3. Configure /var/www/redmine/config/database.yml (rename database.yml.example)
172
173
h3. Set the production environment (optional)
174 7 Thibault B
175 1 Serafim J Fagundes
Uncomment the following line in file redmine/config/environment.rb:
176 3 Mischa The Evil
177 1 Serafim J Fagundes
<pre>ENV['RAILS_ENV'] ||= 'production'</pre>
178
179
h3. Generate the session store
180 3 Mischa The Evil
181 1 Serafim J Fagundes
<pre>RAILS_ENV=production bundle exec rake generate_session_store</pre>
182
183
h3. Migrate the database models
184 3 Mischa The Evil
185 1 Serafim J Fagundes
<pre>RAILS_ENV=production bundle exec rake db:migrate</pre>
186
187
h3. Load default data (optional)
188 3 Mischa The Evil
189 1 Serafim J Fagundes
<pre>RAILS_ENV=production bundle exec rake redmine:load_default_data</pre>
190
191
Follow instructions.
192 25 Johannes M.
193 1 Serafim J Fagundes
h3. Rename dispatch CGI files in /var/www/redmine/public/
194 3 Mischa The Evil
195
<pre>
196 1 Serafim J Fagundes
mv dispatch.cgi.example dispatch.cgi
197
mv dispatch.fcgi.example dispatch.fcgi
198 3 Mischa The Evil
mv dispatch.rb.example dispatch.rb
199 1 Serafim J Fagundes
</pre>
200
201 5 Mauro Mazzieri
h3. Edit .htaccess file for CGI dispatch configuration
202
203
<pre>
204
mv htaccess.fcgi.example .htaccess
205 1 Serafim J Fagundes
</pre>
206
207
h3. Chown and Chmod files for read/write access for the Apache user
208 3 Mischa The Evil
209
<pre>
210 1 Serafim J Fagundes
cd ..
211
chown -R apache:apache redmine-1.x
212 3 Mischa The Evil
chmod -R 755 redmine-1.x
213 2 Serafim J Fagundes
</pre>
214 1 Serafim J Fagundes
215
h3. Redmine should be fully installed now and fully usable
216
217
Enjoy!