第三步:安装完成之后进入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
yum -y install mysql mysql-server
如果出现端口被占用,可以用下面的命令结束进程
# rm -f /var/run/yum.pid
服务开机启动:命令
chkconfig mysqld on
service mysqld start
给mysql数据库设置密码:命令:
/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版本管理系统:
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"
执行bundle,
bundle install
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’
在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
关闭后台运行:kill -9 pid
至此,Redmine1.0安装完成。
前提:redmine1.0安装并运行成功
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
更新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
进入redmine3.3目录:安装bundler:
gem install bundler
依赖组件安装:bundle install --without development test rmagick:
第三步:安装完成之后进入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”
将Gemfile的mysql2版本改成0.4.4
vi Gemfile
之前安装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生成表结构
RAILS_ENV=production bundle exec rake redmine:load_default_data初始化数据,选择zh
Ruby bin/rails server webrick -e production -d
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)