CentOS 6.6 安裝redmine


Redmine是一個開源的、基於Web的項目管理和缺陷跟蹤工具。它用日歷和甘特圖輔助項目及進度可視化顯示。同時它又支持多項目管理。Redmine是一個自由開放源碼軟件解決方案,它提供集成的項目管理功能,問題跟蹤,並為多個版本控制選項的支持。雖說像IBM Rational Team Concert的商業項目調查工具已經很強大了,但想堅持一個自由和開放源碼的解決方案,可能會發現Redmine是一個有用的Scrum和敏捷的選擇。 由於Redmine的設計受到Rrac的較大影響,所以它們的軟件包有很多相似的特征。Redmine建立在Ruby on Rails的框架之上,它可以誇平台和數據庫。

前提安裝redmine ruby環境版本要求:

Redmine version Supported Ruby versions Rails version used
3.3, current trunk ruby 1.9.3, 2.0.0, 2.1, 2.2, 2.3 Rails 4.2
3.2, 3.1 ruby 1.9.3, 2.0.0, 2.1, 2.2 Rails 4.2

安裝依賴關系

yum install zlib-devel openssl-devel ImageMagick-devel wget curl-devel rubygems mod_fcgid

安裝rvm

# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
# curl -sSL https://get.rvm.io | bash -s stable
...
# Administrator,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: https://rvm.io/help and https://twitter.com/rvm_io

載入RVM環境並獲取需要的支持安裝包

# source /etc/profile.d/rvm.sh
# rvm requirements

利用rvm安裝 Ruby 2.2.3 並設為默認

# sed -i -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' /usr/local/rvm/config/db
# rvm gemset create
# rvm install 2.2.3
# rvm use 2.2.3 --default

安裝時有可能會遇到下面的錯誤:

[root@db-02 ~]#  rvm install 2.2.3
Already installed ruby-2.2.3.
To reinstall use:

    rvm reinstall ruby-2.2.3

Gemset '' does not exist, 'rvm ruby-2.2.3 do rvm gemset create ' first, or append '--create'.

按照提示我們可以重新安裝或者使用:

#  rvm install 2.2.3 --create

安裝rails

由於國內網絡原因(你懂的),導致rubygems.org存放 Amazon S3上面的資源文件間歇性連接失敗。所以你會與遇到gem install rack或bundle install的時候半天沒有響應,具體可以用gem install rails -V來查看執行過程。下面替換成淘寶的GEM鏡像站:

# 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/

安裝rails 4.2

# gem install rails -v=4.2

安裝mysql和httpd

# yum install httpd httpd-devel -y
# yum install -y mysql*
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'redmine';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';

安裝redmine的apache支持,這樣可以通過apache訪問

# gem install passenger
# passenger-install-apache2-module

# vim /etc/httpd/conf.d/passenger.conf
   LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.3/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/rvm/gems/ruby-2.2.3/gems/passenger-5.0.30
     PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.3/wrappers/ruby
   </IfModule>

# vim /etc/httpd/conf.d/redmine.conf
<VirtualHost *:80>
      ServerName www.a.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /var/www/html/redmine/public
  ErrorLog logs/redmine_error_log
      <Directory /var/www/html/redmine/public>
        Options Indexes ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews
        # Uncomment this if you're on Apache >= 2.4:
        #Require all granted
      </Directory>
  </VirtualHost>

安裝redmine

# cd /var/www/html
# wget http://www.redmine.org/releases/redmine-3.1.1.tar.gz
# tar -zxvf redmine-3.1.1.tar.gz
# mv redmine-3.1.1 redmine
# cd /var/www/html/redmine/
# vim Gemfile
#source 'https://rubygems.org'
source'https://ruby.taobao.org'
# cp config/configuration.yml.example config/configuration.yml
# cp config/database.yml.example config/database.yml
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8

安裝管理ruby的包依賴的工具bundler

下面安裝很容易報錯,如果報錯請嘗試重新安裝。

# gem install bundler  #注意是在網站根目錄下執行
# bundle install 

為Rails生成cookies秘鑰

# rake generate_secret_token

初始化redmine數據庫表名

# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data

修改fastcgi

# cd /var/www/html/redmine/public/
# cp dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess

以上操作以后就可以在瀏覽器中輸入www.a.com進行范圍redmine,但是請提前做好域名的解析,如果不想做域名解析可以使用IP進行配置訪問,具體IP訪問配置這里就不做介紹了,

如果安裝錯誤可以測試看redmine的問題還是httpd的問題。

在WEBrick服務上測試Redmine是否安裝成功

# bundle exec rails server webrick -e production -b 0.0.0.0

地址:http://IP:3000 (注意:打開iptables 3000端口號)
缺省管理員用戶:
login: admin
password: admin


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM