Steps for installing Redmine2.6 (integrating Apache2.4) under CentOS 6

Source: Internet
Author: User
Tags diff centos create database port number redmine ruby on rails

Although commercial project survey tools like IBM Rational Team Concert are already powerful, they want to stick to a free and open source solution, redmine may be a useful Scrum and agile choice. Because Redmine's design is greatly affected by Rrac, their software packages have many similar features. Redmine is built on the Ruby on Rails framework. It can boast platforms and databases.

1. Initial environment

System version: CentOS-6.6-x86_64-minimal.iso
Install LAMP (if Nginx is not installed, Apache is used for integration with Redmine). For more information, see lnmp one-key installation package; modify options. conf, home_dir =/data/wwwroot

2. ruby installation

The code is as follows: Copy code
Cd lnmp/src
Wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
Tar xzf ruby-2.1.5.tar.gz
Cd ruby-2.1.5
./Configure -- prefix =/usr/local/ruby
Make & make install
Cd ..

Add to environment variable

The code is as follows: Copy code
Vi/etc/profile
Export PATH =/usr/local/ruby/bin: $ PATH
./Etc/profile

View ruby version

The code is as follows: Copy code
# Ruby-v
Ruby 2.1.5p273 (revision 48405) [x86_64-linux]

3. Install rails

The code is as follows: Copy code
# Install gem
Wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.5.tgz
Tar xzf rubygems-2.4.5.tgz
Cd rubygems-2.4.5
Ruby setup. rb

Cd ..
Tip: gem is a file organization package. Many plug-ins in ruby are provided by these various packages.

The code is as follows: Copy code
# Gem-v
2.4.5
# Which gem
/Usr/local/ruby/bin/gem

Because of the domestic network (you know), rubygems.org fails to store resource files on Amazon S3 intermittently. Therefore, you will not respond to gem install rack or bundle install for half a day. You can use gem install rails-V to view the execution process. Replace the following with Taobao's GEM image site:

The code is as follows: Copy code

# Gem sources-l
* ** Current sources ***

Https://rubygems.org/

# Gem sources -- remove https://rubygems.org/
Https://rubygems.org/removed from sources
# Gem sources-a https://ruby.taobao.org/
Https://ruby.taobao.org/added to sources
# Gem sources-l
* ** Current sources ***

Https://ruby.taobao.org/

Redmine needs to consider Ruby Version compatibility issues, please refer to: Installing Redmine

The code is as follows: Copy code
Redmine version Supported Ruby versions Rails version used
Current trunk ruby 1.9.3, 2.0.0, 2.1, jruby-1.7.6 Rails 4.1
Trunk <r13482 ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, jruby-1.7.6 Rails 3.2
2.5, 2.6 ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, jruby-1.7.6 Rails 3.2
2.4 ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, jruby-1.7.6 Rails 3.2

Redmine chooses to install version 2.6, so rails installs version 3.2

The code is as follows: Copy code

Gem install rails-v = 3.2

# Rails-v
Rails 3.2.19

4. Install Redmine2.6

The code is as follows: Copy code
Wget http://www.redmine.org/releases/redmine-2.6.0.tar.gz
Tar xzf redmine-2.6.0.tar.gz-C/data/wwwroot
Mv/data/wwwroot/redmine {-2.6.0 ,}

Create a redmine database

The code is as follows: Copy code

Cd/data/wwwroot/redmine
Gem install mysql2 # use mysql2 to provide performance
# Mysql-uroot-p
Mysql> create database redmine;
Make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.

Configure Redmine database. yml

The code is as follows: Copy code
Cd/data/wwwroot/redmine/config
Cp database. yml. example database. yml
Cat database. yum # Modify the database connection information
Production:
Adapter: mysql2
Database: redmine
Host: localhost
Username: root
Password: "linuxeye"
Encoding: utf8

Install All ruby packages on redmine

The code is as follows: Copy code

Cd ..
Gem install bundler # note that it is executed in the root directory of the website
Bundle install -- without development test rmagick # install the redmine dependency package
Bundler is a tool used to manage ruby package dependencies.

Generate cookies for Rails

The code is as follows: Copy code
Rake generate_secret_token

Create database structure

The code is as follows: Copy code
RAILS_ENV = production rake db: migrate

Generate default data

The code is as follows: Copy code
RAILS_ENV = production REDMINE_LANG = zh rake redmine: load_default_data

Adjust file system permissions

The code is as follows: Copy code
Cd/data/wwwroot/redmine
Mkdir-p tmp/pdf public/plugin_assets
Chown-R www. www/data/wwwroot/redmine

Tmp and tmp/pdf (this path is created if it does not exist to generate a PDF file); public/plugin_assets (this path is created if it does not exist, plugins resources)

5. Test whether Redmine is successfully installed on WEBrick.

The code is as follows: Copy code
# Vi/etc/passwd # grant the www user The bash permission. The lnmp script does not have the bash permission to install the www user.
Www: x: 501: 501:/home/www:/bin/bash
# Su www-c "ruby script/rails server webrick-e production-d"

Address: http: // IP: 3000 (note: open the port number of iptables 3000)
Default administrator User:

The code is as follows: Copy code
Login: admin
Password: admin

If the verification is successful, continue the following steps to make Redmine run on the Apache service.

6. Configure Redmine to run on Apache
End webrick service

The code is as follows: Copy code
Cd/data/wwwroot/redmine/public/
Cp dispatch. fcgi. example dispatch. fcgi
Cp htaccess. fcgi. example. htaccess
Chown-R www. www ./*

Install Passenger (used to integrate Apache)

The code is as follows: Copy code
Gem install passenger
Passenger-install-apache2-module

Install fastcgi module for Apache

The code is as follows: Copy code

Cd ~ /Lnmp/src
Wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
Tar zxf mod_fastcgi-2.4.6.tar.gz
Cd mod_fastcgi-2.4.6
Wget http://blog.linuxeye.com/wp-content/uploads/2014/12/byte-compile-against-apache24.diff
Patch-p1 <byte-compile-against-apache24.diff # apache2.4 install mod_fastcgi 2.4.6, patch required
Cp Makefile. AP2 Makefile
Vim Makefile # change the path in Makefile to your apache installation path.
Make & make install # After the installation is successful, mod_fastcgi.so will be automatically copied to the/usr/local/apache/modules Directory
Configure Apache
Vi/usr/local/apache/conf/httpd. conf # add at the end

LoadModule passenger_module/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.55/buildout/apache2/mod_passenger.so
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_passenger.c>
PassengerRoot/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.55
PassengerDefaultRuby/usr/local/ruby/bin/ruby
</IfModule>

<VirtualHost *: 80>
ServerName 192.168.3.10
DocumentRoot/data/wwwroot/redmine/public
ErrorLog "/data/wwwlogs/error_redmine.log"
CustomLog "/data/wwwlogs/access_redmine.log" common
<Directory/data/wwwroot/redmine/public>
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
</VirtualHost>
And unregister # Include conf/vhost/*. conf

Service httpd restart

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.