CentOs6.4上安裝升級(jí)redmine1.0手冊(cè)
第五步:創(chuàng)建redmine數(shù)據(jù)庫(kù)
第六步:配置redmine連接數(shù)據(jù)庫(kù)
Redmine1.0升級(jí)到redmine3.3.0步驟
第三步:安裝完成之后進(jìn)入redmine3.3目錄拢蛋,配置數(shù)據(jù)庫(kù)
先取得管理員權(quán)限迁杨,命令
su root
輸入密碼
然后輸入下面的命令:
yum -y install nano zip unzip libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA
yum -y install mysql mysql-server
如果出現(xiàn)端口被占用伶选,可以用下面的命令結(jié)束進(jìn)程
# rm -f /var/run/yum.pid
服務(wù)開機(jī)啟動(dòng):命令
chkconfig mysqld on
service mysqld start
給mysql數(shù)據(jù)庫(kù)設(shè)置密碼:命令:
/usr/bin/mysql_secure_installation
Because we not have a password for the root account so you press Enter to skip.
Enter current password for root (enter for none):
Select Yes to set the password for the MySQL root account.
Set root password? [Y/n] y
Enter and confirm your password, remove the anonymous user, select Yes
Remove anonymous users? [Y/n] y
Allow remote login to MySQL as root account, select No.
Disallow root login remotely? [Y/n] n
Delete the test database, select Yes
Remove test database and access to it? [Y/n] y
Reload privilege tables, select Yes
Reload privilege tables now? [Y/n] y
\curl -L https://get.rvm.io| bash
source /etc/profile.d/rvm.sh
The following command will list the versions of Ruby to install :
rvm list known
選擇1.8.7版本:命令:
rvm?install?ruby-1.8.7-p374
安裝svn版本管理系統(tǒng):
yum install -y subversion
使用svn下載redmine:
1.cd?/usr/local/
2.svn?co?http://svn.redmine.org/redmine/branches/1.0-stable
3.mv1.0-stable?redmine1.0
4.cd?redmine1.0
5.gem?install?bundler
vi Gemfile
把rails也加在里面:
Gem“rails”,“2.3.5”
# file: redmine/Gemfile
source "http://rubygems.org"
gem"rails","2.3.5"
gem "rake", "0.8.3"
gem "rack", "1.0.1"
gem "i18n", "0.4.2"
gem "rubytree", "0.5.2", :require => "tree"
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7"
執(zhí)行bundle,
bundle install
第五步:創(chuàng)建redmine數(shù)據(jù)庫(kù):
1.mysql?-uroot?-p?#輸入之前設(shè)置的密碼喧务,這里是pwd
2.create database redmine character set utf8;
3.create user 'redmine'@'localhost' IDENTIFIED BY 'pwd';
4.#用戶名:?redmine;?密碼:pwd
5.grant all privileges on redmine.* to 'redmine'@'localhost';?#最大權(quán)限
6.flush privileges;
7.Quit; ??????????????#退出mysql
第六步:配置redmine連接數(shù)據(jù)庫(kù):
進(jìn)入redmine1.0目錄:
cd usr/local/redmine1.0
復(fù)制config/database.yml.example到config/database.yml赖歌,命令如下:
cp config/database.yml.example ?config/database.yml
cd config
編輯database.yml,命令如下:
vi database.yml
用戶名:redmine功茴,密碼用單引號(hào)’pwd’
在redmine1.0目錄下執(zhí)行下面命令:
先執(zhí)行rvm install rubygems 1.4.2 --force
不然會(huì)報(bào)錯(cuò)undefined method `source_index' for Gem:Module (NoMethodError)
相關(guān)網(wǎng)址:http://blog.csdn.net/dazhi_100/article/details/47024163
生成密鑰:
RAILS_ENV=production bundle exec rake generate_session_store
生成數(shù)據(jù)庫(kù)結(jié)構(gòu):
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
選擇默認(rèn)語(yǔ)言:zh
cd public
mv dispatch.cgi.example dispatch.cgi
mv dispatch.fcgi.example dispatch.fcgi
mv dispatch.rb.example dispatch.rb
cd usr/local/redmine1.0
ruby script/server webrick -e production
后臺(tái)運(yùn)行命令:
ruby script/server webrick -e production -d
關(guān)閉后臺(tái)運(yùn)行:kill -9 pid
至此庐冯,Redmine1.0安裝完成。
Redmine1.0升級(jí)到redmine3.3.0步驟:
前提:redmine1.0安裝并運(yùn)行成功
Ruby選擇1.9.3坎穿,rails選擇2.3.14展父,
安裝Ruby1.9.3-p551:
cd /
rvm install ruby-1.9.3-p551
將1.9.3設(shè)置成默認(rèn)使用版本:
rvm --default use 1.9.3-p551
更新rubygems版本:
gem update --system
更新rails版本:
gem install rails -v 2.3.14
更新rake和安裝mysql2(0.4.4):
gem install rake
gem install mysql2
1.cd?/usr/local/
2.svn?co?http://svn.redmine.org/redmine/branches/3.3-stable
3.mv3.3-stable?redmine3.3
4.cd?redmine3.3
5.gem?install?bundler
進(jìn)入redmine3.3目錄:安裝bundler:
gem install bundler
依賴組件安裝:bundle install --without development test rmagick:
第三步:安裝完成之后進(jìn)入redmine3.3目錄,配置數(shù)據(jù)庫(kù):
復(fù)制config/database.yml.example到config/database.yml:
cp config/database.yml.example ?config/database.yml
cd config
編輯database.yml
vi databases.yml
修改下面相應(yīng)的部分
production: ?adapter: mysql2
database: redmine
host: localhost
username: redmine
password:“pwd”
將Gemfile的mysql2版本改成0.4.4
vi Gemfile
之前安裝redmine1.0.1的時(shí)候創(chuàng)建過(guò)表玲昧,但是redmine3.3和1.0的表結(jié)構(gòu)不同栖茉,所以要先刪除之前創(chuàng)建的表:
Mysql -uroot -p
Drop database redmine;
創(chuàng)建數(shù)據(jù)庫(kù)redmine和數(shù)據(jù)庫(kù):
1.create?database?redmine?character?set?utf8;
進(jìn)入redmine3.3目錄,創(chuàng)建一個(gè)session安裝密鑰:
cd usr/local/redmine3.3
rake?generate_secret_token
創(chuàng)建初始化所有redmine用到的table表:
RAILS_ENV=production bundle exec rake db:migrate生成表結(jié)構(gòu)
RAILS_ENV=production bundle exec rake redmine:load_default_data初始化數(shù)據(jù),選擇zh
Ruby bin/rails server webrick -e production -d
Redmine1.0.1升級(jí)至Redmine3.3.0完畢孵延。
附上redmine1.0和3.3版本的數(shù)據(jù)庫(kù)表結(jié)構(gòu):
Redmine3.3數(shù)據(jù)庫(kù)表結(jié)構(gòu):
------------------------------------+
| Tables_in_redmine ??????????????????|
+-------------------------------------+
| attachments ????????????????????????|
| auth_sources ???????????????????????|
| boards ?????????????????????????????|
| changes ????????????????????????????|
| changeset_parents ??????????????????|
| changesets ?????????????????????????|
| changesets_issues ??????????????????|
| comments ???????????????????????????|
| custom_field_enumerations ??????????|
| custom_fields ??????????????????????|
| custom_fields_projects ?????????????|
| custom_fields_roles ????????????????|
| custom_fields_trackers ?????????????|
| custom_values ??????????????????????|
| documents ??????????????????????????|
| email_addresses ????????????????????|
| enabled_modules ????????????????????|
| enumerations ???????????????????????|
| groups_users ???????????????????????|
| import_items ???????????????????????|
| imports ????????????????????????????|
| issue_categories ???????????????????|
| issue_relations ????????????????????|
| issue_statuses ?????????????????????|
| issues ?????????????????????????????|
| journal_details ????????????????????|
| journals ???????????????????????????|
| member_roles ???????????????????????|
| members ????????????????????????????|
| messages ???????????????????????????|
| news ???????????????????????????????|
| open_id_authentication_associations |
| open_id_authentication_nonces ??????|
| projects ???????????????????????????|
| projects_trackers ??????????????????|
| queries ????????????????????????????|
| queries_roles ??????????????????????|
| repositories ???????????????????????|
| roles ??????????????????????????????|
| roles_managed_roles ????????????????|
| schema_migrations ??????????????????|
| settings ???????????????????????????|
| time_entries ???????????????????????|
| tokens ?????????????????????????????|
| trackers ???????????????????????????|
| user_preferences ???????????????????|
| users ??????????????????????????????|
| versions ???????????????????????????|
| watchers ???????????????????????????|
| wiki_content_versions ??????????????|
| wiki_contents ??????????????????????|
| wiki_pages ?????????????????????????|
| wiki_redirects ?????????????????????|
| wikis ??????????????????????????????|
| workflows ??????????????????????????|
+-------------------------------------+
Redmine1.0表結(jié)構(gòu):
+-------------------------------------+
| Tables_in_redmine ??????????????????|
+-------------------------------------+
| attachments ????????????????????????|
| auth_sources ???????????????????????|
| boards ?????????????????????????????|
| changes ????????????????????????????|
| changesets ?????????????????????????|
| changesets_issues ??????????????????|
| comments ???????????????????????????|
| custom_fields ??????????????????????|
| custom_fields_projects ?????????????|
| custom_fields_trackers ?????????????|
| custom_values ??????????????????????|
| documents ??????????????????????????|
| enabled_modules ????????????????????|
| enumerations ???????????????????????|
| groups_users ???????????????????????|
| issue_categories ???????????????????|
| issue_relations ????????????????????|
| issue_statuses ?????????????????????|
| issues ?????????????????????????????|
| journal_details ????????????????????|
| journals ???????????????????????????|
| member_roles ???????????????????????|
| members ????????????????????????????|
| messages ???????????????????????????|
| news ???????????????????????????????|
| open_id_authentication_associations |
| open_id_authentication_nonces ??????|
| projects ???????????????????????????|
| projects_trackers ??????????????????|
| queries ????????????????????????????|
| repositories ???????????????????????|
| roles ??????????????????????????????|
| schema_migrations ??????????????????|
| settings ???????????????????????????|
| time_entries ???????????????????????|
| tokens ?????????????????????????????|
| trackers ???????????????????????????|
| user_preferences ???????????????????|
| users ??????????????????????????????|
| versions ???????????????????????????|
| watchers ???????????????????????????|
| wiki_content_versions ??????????????|
| wiki_contents ??????????????????????|
| wiki_pages ?????????????????????????|
| wiki_redirects ?????????????????????|
| wikis ??????????????????????????????|
| workflows ??????????????????????????|
+-------------------------------------+
47 rows in set (0.00 sec)