前置条件
需要安装 ruby,rubygems,rake,rails和mysql数据库。
安装Redmine 和 Ruby、Rails对应的版本:
Redmine version | Supported Ruby versions | Rails version used |
3.0
ruby 1.9.3, 2.0.0, 2.1, 2.2Rails 4.2
2.6
ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, jruby-1.7.6 Rails 3.2
- 安装Ruby
下载Ruby安装包并进行安装(切换至root用户安装):
复制代码- wget ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz
- tar zxf ruby-2.1.4.tar.gz
- cd ruby-2.1.4
- ./configure
- make
- make install
复制代码- ruby -v
- 安装Rubygems
下载Rubygems安装包并进行安装 (切换至root):
复制代码- wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.1.tgz
- tar zxf rubygems-2.4.1.tgz
- cd rubygems-2.4.1
- ruby setup.rb
复制代码- gem -v
- 安装Rails(版本为3.2.1.9)、mongrel
由于Rails被屏蔽了,需要先修改地址:复制代码- gem sources --remove https://rubygems.org/
- gem sources -a https://ruby.taobao.org/
确认是否修改成功:复制代码- gem sources -l
显示如下则代表成功:复制代码- *** CURRENT SOURCES ***
- https://ruby.taobao.org/
复制代码- gem install rails
- gem install mongrel
- 安装mysql
如果已经安装则跳过此步:
复制代码- yum install -y mysql-server mysql mysql-devel
复制代码- mysql> create database redmine character set utf8;
- mysql> create user 'redmine'@'localhost' identified by 'redmine';
- mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
- 安装Redmine
下载redmine包:复制代码- wget http://www.redmine.org/releases/redmine-3.0.3.tar.gz
复制代码- tar zxf redmine-3.0.3.tar.gz
- cd redmine-3.0.3
- cp config/database.yml.example config/database.yml
- vi config/database.yml
复制代码- production:
- adapter: mysql2
- database: redmine
- host: localhost
- username: redmine
- password: "redmine"
- encoding: utf8
-
检查并安装其它依赖包
复制代码- su root
- gem install bundler
- gem install jquery-rails
- gem install rake -v '10.4.2'
- gem install json -v '1.8.3'
- gem install actionpack-action_caching -v '1.1.1'
- gem install actionpack-xml_parser -v '1.0.2'
- gem install coderay -v '1.1.0'
- gem install jquery-rails -v '3.1.2'
- gem install mysql2 -v '0.3.18'
- gem install net-ldap -v '0.3.1'
- gem install protected_attributes -v '1.0.9'
- gem install ruby-openid -v '2.3.0'
- gem install rack-openid -v '1.4.2'
- gem install rbpdf -v '1.18.5'
- gem install redcarpet -v '3.1.2'
- gem install request_store -v '1.0.5'
退出root用户执行:复制代码- cd redmine-3.0.3
- bundle exec rake generate_secret_token
-
会话缓存
复制代码- bundle exec rake generate_secret_token
-
导入数据库并设置语言
复制代码- RAILS_ENV=production bundle exec rake db:migrate
- RAILS_ENV=production bundle exec rake redmine:load_default_data
-
文件系统权限
复制代码- mkdir -p tmp tmp/pdf public/plugin_assets
- sudo chmod -R 755 files log tmp public/plugin_assets
-
测试安装
执行命令:
复制代码- bundle exec rails server webrick -e production
复制代码- http://longyi.localhost:3000/
如果可以打开redmine界面,则表示配置成功。登录用户名:admin
登录密码:admin -
SMTP邮箱配置
复制代码- cd redmine-3.0.3
- cp config/configuration.yml.example config/configuration.yml
- vi config/ configuration.yml
复制代码- email_delivery:
- delivery_method: :smtp
- smtp_settings:
- address: "smtp.qq.com"
- port: 25
- authentication: :login
- domain: 'qq.com'
- user_name: '<QQ邮箱账号>'
- password: '<QQ邮箱密码>'