原来工程师搭建的Redmine,由于机器坏掉,需要转移。
Redmine 是一个开源的、基于Web的项目管理和缺陷跟踪工具。它用日历和甘特图辅助项目及进度可视化显示。同时它又支持多项目管理。Redmine是一个自由开放 源码软件解决方案,它提供集成的项目管理功能,问题跟踪,并为多个版本控制选项的支持。
安装环境CentOS 5.8 64位。
安装最新稳定版本Redmine-2.4.5[由于不知道原来的版本所以选择版本高一些]。
安装:
1:Redmine建立在Ruby on Rails的框架之上,支持跨平台和多种数据库。
所以需要提前ruby等一些依赖包。
yum -y install curlcurl -L get.rvm.io | bash -s stablesource /etc/profile.d/rvm.shrvm install 1.9.3gem install rdocgem install railsrvm requirementsgem install bundler
2:下载Redmine链接:
放到需要安装的路径:
tar -zxvf redmine-2.4.5.gzln -s /usr/local/services/redmine-2.4.5 /usr/local/services/redmine设置软连接为了记录redmine的版本号
3:设置mysql数据库账号和密码:
mysql> create database redmine character set utf8;mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by '123456';mysql> grant all privileges on redmine.* to 'redmine'@'127.0.0.1' identified by '123456'; mysql> flush privileges;
4:修改redmine的配置:
cd /usr/local/services/redmine/configcp database.yml.example database.ymlvi database.ymlproduction: adapter: mysql2 database: redmine host: localhost username: redmine password: "123456" encoding: utf8development: adapter: mysql2 database: redmine_development host: localhost username: redmine password: "123456" encoding: utf8test: adapter: mysql2 database: redmine_test host: localhost username: redmine password: "123456" encoding: utf8cp configuration.yml.example configuration.ymlvi configuration.yml# default configuration options for all environmentsdefault: # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: address: 127.0.0.1 port: 25 domain: localhost authentication: :login user_name: "redmine@example.net" password: "redmine"## production: email_delivery: delivery_method: :smtp smtp_settings: address: 127.0.0.1 port: 25 domain: localhost
5:进行下一步的安装:
cd /usr/local/services/redmine/bundle install --without development test postgresql sqlite rmagickgem install mysql2 -v '0.3.15' -- --with-mysql-config=[数据库mysql_config的路径]rake generate_secret_token如果报错需要执行:bundle update当然可能还会有报错,但是在报错的最后一行会有提示安装什么软件。
6:建立数据库结构:
RAILS_ENV=production rake db:migrateRAILS_ENV=production rake redmine:load_default_dataSelect language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, 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, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] zh====================================mkdir -p tmp tmp/pdf public/plugin_assetschown -R apache:apache files log tmp public/plugin_assetschmod -R 755 files log tmp public/plugin_assetsgem install passengerpassenger-install-apache2-module
7:可以尝试重启redmine
nohup ruby /usr/local/services/redmine/script/rails server webrick -e production 2&>redmine.log &
8:一些报错:
0):出现下面报错时需要执行 bundle update
[root@user redmine]# rake generate_secret_tokenCould not find gem 'rails (= 3.2.17) ruby' in the gems available on this machine.Run `bundle install` to install missing gems.
1):bundle update时,根据提示安装软件包即可解决问题。
提示下面显示时为好。
Fetching gem metadata from https://rubygems.org/.........Fetching additional metadata from https://rubygems.org/..Resolving dependencies...Using rake 10.1.1Using i18n 0.6.9Using multi_json 1.10.0Using activesupport 3.2.17Using builder 3.0.0Using activemodel 3.2.17Using erubis 2.7.0Using journey 1.0.4Using rack 1.4.5Using rack-cache 1.2Using rack-test 0.6.2Using hike 1.2.3Using tilt 1.4.1Using sprockets 2.2.2Using actionpack 3.2.17Using mime-types 1.25.1Using polyglot 0.3.4Using treetop 1.4.15Using mail 2.5.4Using actionmailer 3.2.17Using arel 3.0.3Using tzinfo 0.3.39Using activerecord 3.2.17Using activeresource 3.2.17Using bundler 1.6.2Using coderay 1.1.0Using rack-ssl 1.3.4Using json 1.8.1Using rdoc 3.12.2Using thor 0.19.1Using railties 3.2.17Using jquery-rails 2.0.3Using mysql2 0.3.15Using net-ldap 0.3.1Using ruby-openid 2.3.0Using rack-openid 1.4.2Using rails 3.2.17Your bundle is updated!Gems in the groups development, test, postgresql, sqlite and rmagick were not installed.
2):redmine启动时报错。
报错原因是3000端口占用,查询方法:
netstat -ntlp | grep 3000
附:
linux环境方面需要补充的是:
1.需要安装httpd;
2.需要安装mysql;
3.需要添加ruby的执行路径;
vim /root/.bash_profilePATH=$PATH:$HOME/bin:/usr/local/ruby/binsource /root/.bash_profile
9:最后可以打开链接访问了,坏的机器还没有运回公司等待迁移中。