Project

General

Profile

HowTo install Redmine on CentOS 5 » History » Version 30

Nick Shel, 2012-03-05 09:06
Simplified

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