CentOS Redmine Installation

Source: Internet
Author: User
Tags i18n redmine
Document directory
  • System Basics:
  • Install ruby and rubygems
  • Install rails
  • Install rack
  • Install Database Support

Version history:

[V0.9.2.20120102] [update, applicable to redmine 1.3.0]

[V0.9.1.20111021] [initial installation, based on redmine 1.2.2]

 

Preparations: System Basics:

Operating System: CentOS 5.7, updated to 20120102.

Because the ruby version installed by yum is 1.8.5, but the ruby version required by redmine is 1.8.6 or 1.8.7, we recommend that you uninstall it if the system has ruby-related stuff installed.

I only installed ruby and rubygems. You can uninstall them as follows (ruby * can be used for all uninstallation. Note that uninstalling ruby will cause cacti and rrdtool installed in yum to be uninstalled)

sudo yum erase ruby rubygems

Install the basic dependency packages used by ruby:

sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel \\ 
openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

To facilitate compilation and installation of ruby.

Install ruby and rubygems

1. Install ruby

Download ruby 1.8.7-p352 in the ftp://ftp.ruby-lang.org/pub/ruby.

Compile and install

cd ruby-1.8.7.pXXX./configuremakesudo make installruby -v

By default, the compiled ruby file is in/usr/local/bin. Note that/usr/local may need to be added to the user's PATH.

2. Install rubygems

In http://rubyforge.org/frs? Group_id = 126 & release_id = 46340 download the rubygems 1.3.7 installation package (note that you must never use the latest version, such as 1.8.12, if 1.8.12 is used, an error is reported in the following steps ).

Install by referring to the http://rubygems.org/pages/download and switch to the rubygems directory for execution

[gaohu@localhost rubygems-1.3.7]$ sudo ruby setup.rb 
RubyGems 1.3.7 installed
...
RubyGems installed the following executables:
    /usr/local/bin/gem

[gaohu@localhost rubygems-1.3.7]$
Install rails

1. First, we want to talk about the normal path.

[gaohu@rzgh ~]$ sudo gem install rails -v=2.3.14

Basically, an error is reported:

ERROR:  http://gems.rubyforge.org/ does not appear to be a repositoryERROR:  could not find gem rails locally or in a repository

I also tried to add ruby sources and found that the effects were not good. I had to download them manually.

It is said that the address has been walled, so we use local installation to install it.

2. Download rails

Download the rails gem package in the http://rubygems.org/pages/download (major version, be sure to download version 2.3.14), while recursively downloading the dependency package, also need to download the corresponding version.

(Or you can use Bundler for processing and research .)

You will probably get a lot and save them to a folder. We recommend that you create a folder named redmine. We still have many packages to download.

I probably downloaded these to install rails (the following are all installed packages. If this step is not used so much, you can download it based on software dependencies)

[gaohu@rzgh redmine]$ lsactionmailer-2.3.14.gem  activeresource-2.3.14.gem    fastthread-1.0.7.gem  mysql-2.8.1.gem       rails-2.3.14.gem          
rubygems-update-1.8.12.gem
actionpack-2.3.14.gem    activesupport-2.3.14.gem     fcgi-0.8.8.gem        passenger-3.0.11.gem  rake-0.8.7.gem
activerecord-2.3.14.gem  daemon_controller-0.2.6.gem  i18n-0.4.2.gem        rack-1.1.1.gem

3. Install rails

[gaohu@localhost redmine]$ sudo gem install --local rails-2.3.14.gem 
Successfully installed rake-0.8.7
Successfully installed activesupport-2.3.14
Successfully installed activerecord-2.3.14
Successfully installed rack-1.1.1
Successfully installed actionpack-2.3.14
Successfully installed actionmailer-2.3.14
Successfully installed activeresource-2.3.14
Successfully installed rails-2.3.14
8 gems installed
Installing ri documentation for rake-0.8.7...
Installing ri documentation for activesupport-2.3.14...
Installing ri documentation for activerecord-2.3.14...
Installing ri documentation for rack-1.1.1...
Installing ri documentation for actionpack-2.3.14...
Installing ri documentation for actionmailer-2.3.14...
Installing ri documentation for activeresource-2.3.14...
Installing ri documentation for rails-2.3.14...
Installing RDoc documentation for rake-0.8.7...
Installing RDoc documentation for activesupport-2.3.14...
Installing RDoc documentation for activerecord-2.3.14...
Installing RDoc documentation for rack-1.1.1...
Installing RDoc documentation for actionpack-2.3.14...
Installing RDoc documentation for actionmailer-2.3.14...
Installing RDoc documentation for activeresource-2.3.14...
Installing RDoc documentation for rails-2.3.14...
[gaohu@rzgh redmine]$

(The packages listed in this step should be rails dependencies .)
Rails installation is complete.

Install rack

Download, rack 1.1.1

[gaohu@localhost redmine]$ sudo gem install --local rack-1.1.1.gemSuccessfully installed rack-1.1.11 gem installedInstalling ri documentation for rack-1.1.1...Installing RDoc documentation for rack-1.1.1...[gaohu@localhost redmine]$ 
Install Database Support

I select mysql and other databases.

Download ruby mysql gem and install

[gaohu@rzgh redmine]$ sudo gem install --local mysql-2.8.1.gem Building native extensions.  This could take a while...Successfully installed mysql-2.8.11 gem installedInstalling ri documentation for mysql-2.8.1...No definition for next_result...No definition for error_sqlstate[gaohu@rzgh redmine]$ 

I reported a bunch of errors. I don't know if there is any impact. Please wait and check.

Install redmine

1. Create a database

create database redmine character set utf8;create user 'redmine'@'localhost' identified by 'my_password';grant all privileges on redmine.* to 'redmine'@'localhost';

2. Download redmine and decompress it to the httpd server folder. For my,

[gaohu@rzgh ~]$ cd /var/www/html[gaohu@rzgh html]$ sudo mv /home/gaohu/redmine-1.2.2 ./[gaohu@rzgh html]$ sudo mv redmine-1.2.2/ redmine

3. Edit the database. yml File

[gaohu@rzgh redmine]$ sudo cp config/database.yml.example config/database.yml[gaohu@rzgh redmine]$ sudo vi config/database.yml

Adjust the database and password of the production database:

production:  adapter: mysql  database: redmine  host: localhost  username: redmine  password: my_password

Before the password, remember a space after the colon. Otherwise, The sudo RAILS_ENV = production rake db: migrate will report an error.

[gaohu@rzgh redmine]$ sudo RAILS_ENV=production rake db:migrateNOTE: SourceIndex.new(hash) is deprecated; From /var/www/html/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.    at /usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rbWARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.    at /var/www/html/redmine/lib/tasks/email.rake:170rake aborted!syntax error on line 8, col 2: `  encoding: utf8'Tasks: TOP => db:migrate => environment(See full trace by running task with --trace)

4. Generate session Storage

[gaohu@localhost redmine-1.3.0]$ sudo rake generate_session_store
(in /usr/local/share/redmine-1.3.0)
Please install RDoc 2.4.2+ to generate documentation.

Start installing rdoc (we recommend that you install i18n 0.4.2 together ). Download rdoc and dependencies

[gaohu@localhost redmine]$ sudo gem install --local rdoc-2.5.3.gem 
Successfully installed rdoc-2.5.3
1 gem installed
Installing ri documentation for rdoc-2.5.3...
Installing RDoc documentation for rdoc-2.5.3...
[gaohu@localhost redmine]$ sudo gem install --local rdoc-data-2.5.3.gem
To install ri data for RDoc 2.5+ run:

rdoc-data

Successfully installed rdoc-data-2.5.3
1 gem installed
Installing ri documentation for rdoc-data-2.5.3...
Installing RDoc documentation for rdoc-data-2.5.3...
[gaohu@localhost redmine]$ sudo rdoc-data --install

Re-Execute

[gaohu@localhost redmine-1.3.0]$ sudo rake generate_session_store
(in /usr/local/share/redmine-1.3.0)

5. Create a database structure and run it in the redmine path.

[gaohu@localhost redmine-1.3.0]$ sudo RAILS_ENV=production rake db:migrate

6. Insert default data

[gaohu@localhost redmine-1.3.0]$ sudo RAILS_ENV=production rake redmine:load_default_data
(in /usr/local/share/redmine-1.3.0)

Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
====================================
Default configuration data loaded.

7. Set permissions

[gaohu@localhost redmine-1.3.0]$ sudo mkdir tmp public/plugin_assets
mkdir: cannot create directory `tmp': File exists
mkdir: cannot create directory `public/plugin_assets': File exists
[gaohu@localhost redmine-1.3.0]$ sudo chown -R redmine:redmine files log tmp public/plugin_assets
chown: `redmine:redmine': invalid user
[gaohu@localhost redmine-1.3.0]$ sudo chown -R apache:apache files log tmp public/plugin_assets
[gaohu@localhost redmine-1.3.0]$ sudo chmod -R 755 files log tmp public/plugin_assets

8. test and install the tool through WEBrick web server

[gaohu@localhost redmine-1.3.0]$ sudo ruby script/server webrick -e production
=> Booting WEBrick
=> Rails 2.3.14 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-01-03 00:16:50] INFO WEBrick 1.3.1
[2012-01-03 00:16:50] INFO ruby 1.8.7 (2011-12-28) [i686-linux]
[2012-01-03 00:16:55] INFO WEBrick::HTTPServer#start: pid=18704 port=3000

Access Server http: // localhost: 3000 port test.

9. Use default administrator account to log in:

  • Login: admin
  • Password: admin

You can goAdmin & SettingsTo modify application settings.

Integration with apache

Waiting for Supplement

Refer:

Http://www.redmine.org/projects/redmine/wiki/RedmineInstall

 

Appendix:

1. If a later version of rubygems (for example, 1.8.12) is used, an error is returned when you execute the following command:

.[gaohu@localhost redmine-1.3.0]$ sudo rake generate_session_store
(in /usr/local/share/redmine-1.3.0)
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/local/share/redmine-1.3.0/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
rake aborted!
uninitialized constant Gem::SyckDefaultKey
/usr/local/share/redmine-1.3.0/Rakefile:4
(See full trace by running task with --trace)

Solution: downgrade to version 1.3.7.

Reference: http://www.redmine.org/boards/2/topics/27792

Http://www.redmine.org/boards/2/topics/27928

2

3

4


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.