原來工程師搭建的Redmine,由於機器壞掉,需要轉移。
Redmine 是一個開源的、基於Web的項目管理和缺陷跟蹤工具。它用日曆和甘特圖輔助項目及進度可視化顯示。同時它又支持多項目管理。Redmine是一個自由開放 源碼軟件解決方案,它提供集成的項目管理功能,問題跟蹤,併爲多個版本控制選項的支持。
安裝環境CentOS 5.8 64位。
安裝最新穩定版本Redmine-2.4.5[由於不知道原來的版本所以選擇版本高一些]。
安裝:
1:Redmine建立在Ruby on Rails的框架之上,支持跨平臺和多種數據庫。
所以需要提前ruby等一些依賴包。
yum -y install curl curl -L get.rvm.io | bash -s stable source /etc/profile.d/rvm.sh rvm install 1.9.3 gem install rdoc gem install rails rvm requirements gem install bundler
2:下載Redmine鏈接:
http://www.redmine.org/projects/redmine/wiki/Download
放到需要安裝的路徑:
tar -zxvf redmine-2.4.5.gz ln -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/config cp database.yml.example database.yml vi database.yml production: adapter: mysql2 database: redmine host: localhost username: redmine password: "123456" encoding: utf8 development: adapter: mysql2 database: redmine_development host: localhost username: redmine password: "123456" encoding: utf8 test: adapter: mysql2 database: redmine_test host: localhost username: redmine password: "123456" encoding: utf8 cp configuration.yml.example configuration.yml vi configuration.yml # default configuration options for all environments default: # 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: "[email protected]" 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 rmagick gem install mysql2 -v '0.3.15' -- --with-mysql-config=[數據庫mysql_config的路徑] rake generate_secret_token 如果報錯需要執行:bundle update 當然可能還會有報錯,但是在報錯的最後一行會有提示安裝什麼軟件。
6:建立數據庫結構:
RAILS_ENV=production rake db:migrate RAILS_ENV=production rake redmine:load_default_data Select 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_assets chown -R apache:apache files log tmp public/plugin_assets chmod -R 755 files log tmp public/plugin_assets gem install passenger passenger-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_token Could 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.1 Using i18n 0.6.9 Using multi_json 1.10.0 Using activesupport 3.2.17 Using builder 3.0.0 Using activemodel 3.2.17 Using erubis 2.7.0 Using journey 1.0.4 Using rack 1.4.5 Using rack-cache 1.2 Using rack-test 0.6.2 Using hike 1.2.3 Using tilt 1.4.1 Using sprockets 2.2.2 Using actionpack 3.2.17 Using mime-types 1.25.1 Using polyglot 0.3.4 Using treetop 1.4.15 Using mail 2.5.4 Using actionmailer 3.2.17 Using arel 3.0.3 Using tzinfo 0.3.39 Using activerecord 3.2.17 Using activeresource 3.2.17 Using bundler 1.6.2 Using coderay 1.1.0 Using rack-ssl 1.3.4 Using json 1.8.1 Using rdoc 3.12.2 Using thor 0.19.1 Using railties 3.2.17 Using jquery-rails 2.0.3 Using mysql2 0.3.15 Using net-ldap 0.3.1 Using ruby-openid 2.3.0 Using rack-openid 1.4.2 Using rails 3.2.17 Your 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_profile PATH=$PATH:$HOME/bin:/usr/local/ruby/bin source /root/.bash_profile
9:最後可以打開鏈接訪問了,壞的機器還沒有運回公司等待遷移中。