Project

General

Profile

HowTo install Redmine on CentOS 5 » History » Version 36

Stephan Schuberth, 2012-03-27 16:17

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