Centos6.4下安装redmine1.0并升级到redmin
第三步:安装完成之后进入redmine3.3目录,配置数据库
先取得管理员权限,命令
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
![](https://img.haomeiwen.com/i2763479/98f6802eca95b792.png)
yum -y install mysql mysql-server
如果出现端口被占用,可以用下面的命令结束进程
# rm -f /var/run/yum.pid
![](https://img.haomeiwen.com/i2763479/15f6a47bbc12a56f.png)
服务开机启动:命令
chkconfig mysqld on
service mysqld start
给mysql数据库设置密码:命令:
/usr/bin/mysql_secure_installation
![](https://img.haomeiwen.com/i2763479/eb13869df4aeda6c.png)
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
![](https://img.haomeiwen.com/i2763479/17ddb8cd634a6ab5.png)
\curl -L https://get.rvm.io| bash
![](https://img.haomeiwen.com/i2763479/3fc47bd1a42ca589.png)
source /etc/profile.d/rvm.sh
The following command will list the versions of Ruby to install :
rvm list known
![](https://img.haomeiwen.com/i2763479/2a48e0e89105715d.png)
选择1.8.7版本:命令:
rvm install ruby-1.8.7-p374
![](https://img.haomeiwen.com/i2763479/e89315a1daabbf5d.png)
安装svn版本管理系统:
yum install -y subversion
![](https://img.haomeiwen.com/i2763479/2b749b1bbbabffe7.png)
使用svn下载redmine:
![](https://img.haomeiwen.com/i2763479/2a3bdf2ccddb3b39.png)
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
![](https://img.haomeiwen.com/i2763479/cfb036487b4755fa.png)
![](https://img.haomeiwen.com/i2763479/f585818c06dcc2ad.png)
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"
执行bundle,
bundle install
![](https://img.haomeiwen.com/i2763479/9136c0e1fccb8475.png)
1.mysql -uroot -p #输入之前设置的密码,这里是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'; #最大权限
6.flush privileges;
7.Quit; #退出mysql
进入redmine1.0目录:
cd usr/local/redmine1.0
复制config/database.yml.example到config/database.yml,命令如下:
cp config/database.yml.example config/database.yml
cd config
编辑database.yml,命令如下:
vi database.yml
用户名:redmine,密码用单引号’pwd’
![](https://img.haomeiwen.com/i2763479/df6cba2c6cfa776a.png)
在redmine1.0目录下执行下面命令:
先执行rvm install rubygems 1.4.2 --force
不然会报错undefined method `source_index' for Gem:Module (NoMethodError)
相关网址:http://blog.csdn.net/dazhi_100/article/details/47024163
生成密钥:
RAILS_ENV=production bundle exec rake generate_session_store
生成数据库结构:
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
选择默认语言: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
后台运行命令:
ruby script/server webrick -e production -d
![](https://img.haomeiwen.com/i2763479/b6945b5a5dfed951.png)
关闭后台运行:kill -9 pid
至此,Redmine1.0安装完成。
前提:redmine1.0安装并运行成功
![](https://img.haomeiwen.com/i2763479/04814b5c1a34b6f4.png)
Ruby选择1.9.3,rails选择2.3.14,
安装Ruby1.9.3-p551:
cd /
rvm install ruby-1.9.3-p551
将1.9.3设置成默认使用版本:
rvm --default use 1.9.3-p551
![](https://img.haomeiwen.com/i2763479/46bd42ebe315d63a.png)
更新rubygems版本:
gem update --system
![](https://img.haomeiwen.com/i2763479/f7a897044bda1b83.png)
更新rails版本:
gem install rails -v 2.3.14
![](https://img.haomeiwen.com/i2763479/848fa0a108707897.png)
更新rake和安装mysql2(0.4.4):
gem install rake
gem install mysql2
![](https://img.haomeiwen.com/i2763479/0a80a8c91370f9c1.png)
![](https://img.haomeiwen.com/i2763479/f045d13da8d67bfd.png)
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
![](https://img.haomeiwen.com/i2763479/dab674e7ca742173.png)
进入redmine3.3目录:安装bundler:
gem install bundler
![](https://img.haomeiwen.com/i2763479/9514a626a25a911d.png)
依赖组件安装:bundle install --without development test rmagick:
![](https://img.haomeiwen.com/i2763479/938cc26195f2806c.png)
第三步:安装完成之后进入redmine3.3目录,配置数据库:
复制config/database.yml.example到config/database.yml:
cp config/database.yml.example config/database.yml
cd config
编辑database.yml
vi databases.yml
修改下面相应的部分
production: adapter: mysql2
database: redmine
host: localhost
username: redmine
password:“pwd”
![](https://img.haomeiwen.com/i2763479/424e8ba63d867c45.png)
将Gemfile的mysql2版本改成0.4.4
vi Gemfile
![](https://img.haomeiwen.com/i2763479/b2b79d1ebb61cab3.png)
之前安装redmine1.0.1的时候创建过表,但是redmine3.3和1.0的表结构不同,所以要先删除之前创建的表:
Mysql -uroot -p
Drop database redmine;
创建数据库redmine和数据库:
1.create database redmine character set utf8;
进入redmine3.3目录,创建一个session安装密钥:
cd usr/local/redmine3.3
rake generate_secret_token
创建初始化所有redmine用到的table表:
RAILS_ENV=production bundle exec rake db:migrate生成表结构
![](https://img.haomeiwen.com/i2763479/e89d35cc39948705.png)
RAILS_ENV=production bundle exec rake redmine:load_default_data初始化数据,选择zh
![](https://img.haomeiwen.com/i2763479/886656123088f661.png)
Ruby bin/rails server webrick -e production -d
![](https://img.haomeiwen.com/i2763479/f184e24c68f4d16d.png)
![](https://img.haomeiwen.com/i2763479/ba0c2fd58daac72e.png)
Redmine1.0.1升级至Redmine3.3.0完毕。
附上redmine1.0和3.3版本的数据库表结构:
Redmine3.3数据库表结构:
------------------------------------+
| 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表结构:
+-------------------------------------+
| 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)