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