Project

General

Profile

HowTo install Redmine on CentOS 5 » History » Version 23

Johannes M., 2011-12-05 21:30

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