Project

General



Profile

HowTo install Redmine on CentOS 5 » History » Version 40

Stephan Schuberth, 2012-03-27 17:37

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