centos安装redmine 2.1.4



centos安装redmine 2.1.4
 
Redmine 2.1.4 http://rubyforge.org/frs/?group_id=1850
Ruby 1.8.7-p371 ftp://ftp.ruby-lang.org/pub/ruby
RubyGems 1.8.24 http://rubygems.org/pages/download
安装软件环境  www.2cto.com  
 
01
# 安装 OpenSSL支持环境
02
yum install openssl openssl-dev
03
 
04
# 安装 Ruby
05
tar zxf ruby-1.8.7-p371.tar.gz
06
cd ruby-1.8.7-p371
07
./configure --prefix=/usr
08
make
09
make install
10
 
11
# 确认版本信息: ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]
12
ruby -v
13
 
14
# 安装 rubygems
15
tar zxf rubygems-1.8.24.tgz
16
cd rubygems-1.8.24
17
ruby setup.rb
18
 
19
# 在线安装其他组件, 组件太多请勿尝试手动安装
20
tar zxf redmine-2.1.4.tar.gz -C /usr/local/
21
cd /usr/local/redmine-2.1.4
22
gem install bundler
23
bundle install --without development test postgresql sqlite rmagick
24
gem install tlsmail
 
创建数据库帐号
1
# Mysql
2
create database redmine character set utf8;
3
grant all privileges on redmine.* to redmine@'%' identified by '123456';
修改配置文件
01
# vim /usr/local/redmine-2.1.4/config/database.yml
02
 
03
# MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
04
#
05
# Get the fast C bindings:
06
#   gem install mysql
07
#   (on OS X: gem install mysql -- --include=/usr/local/lib)
08
# And be sure to use new-style password hashing:
09
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
10
 
11
production:
12
  adapter: mysql
13
  database: redmine
14
  host: localhost
15
  port: 3306
16
  username: redmine
17
  password: 123456
18
  encoding: utf8
安装redmine
01
# 以下为命令界面执行的命令
02
 
03
cd /usr/local/redmine-2.1.4
04
 
05
rake generate_secret_token
06
RAILS_ENV=production rake db:migrate
07
RAILS_ENV=production rake redmine:load_default_data
08
 
09
mkdir tmp public/plugin_assets
10
chown -R redmine:redmine files log tmp public/plugin_assets
11
chmod -R 755 files log tmp public/plugin_assets
12
 
13
# 启动
14
 
15
cd /usr/local/redmine-2.1.4
16
ruby script/rails server webrick -e production -p 3002 &
17
 
18
# 此时可通过浏览器访问,帐号admin 密码admin
 
Nginx 反向代理配置
01
# 增加 Nginx Proxy 后能很大程度上给 redmine 提速
02
 
03
gzip  on;
04
gzip_proxied any;
05
gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/json;
06
proxy_cache_path cache levels=1:2 keys_zone=redmine:256m inactive=60m max_size=4g;
07
 
08
server {
09
    listen       3000;
10
    server_name  localhost;
11
    access_log   off;
12
    location / {
13
        proxy_cache redmine;
14
        proxy_cache_valid 200 304 1m;
15
        proxy_pass  http://backend;
16
        index  index.html index.htm;
17
    }
18
}
19
upstream backend {
20
        server   127.0.0.1:3002;
21
}
 
邮件配置及 Gmail SSL 支持
01
# vim /usr/local/redmine-2.1.4/config/email.yml
02
 
03
# Outgoing email settings
04
production:
05
  delivery_method: :async_smtp
06
  smtp_settings:
07
    enable_starttls_auto: true
08
    address: smtp.gmail.com
09
    port: 587
10
    domain: gmail.com
11
    authentication: :login
12
    user_name: ping.bao.cn@gmail.com
13
    password: redmine123456
14
    tls: true
15
 
16
# Gmail tls_mail Trouble Shootting ......
17
 
18
cd /usr/local/lib/ruby/gems/1.9/gems/tlsmail-0.0.1/lib/
19
cp * /usr/local/redmine-2.1.4/lib/redmine/ -r
20
vim /usr/local/redmine-2.1.4/lib/redmine/net/smtp.rb
21
 
22
class SMTP
23
 
24
   Revision = %q$Revision: 10709 $.split[1]
25
 
26
   # The default SMTP port, port 25.
27
   def SMTP.default_port
28
     25
29
   end
30
 
31
   @use_tls = true
32
   @verify = nil
33
   @certs = nil
34
 
35
   def SMTP.enable_tls(verify = OpenSSL::SSL::VERIFY_PEER, certs = nil)
36
     @use_tls = true
37
     @verify = verify
38
     @certs = certs
39
   end
40
 
41
   def initialize(address, port = nil)
42
     @address = address
43
     @port = (port || SMTP.default_port)
44
     @esmtp = true
45
     @socket = nil
46
     @started = false
47
     @open_timeout = 30
48
     @read_timeout = 60
49
     @error_occured = false
50
     @debug_output = nil
51
     @use_tls = SMTP.use_tls?
52
     @certs = SMTP.certs
53
     @verify = SMTP.verify
54
   end
 

相关内容

    暂无相关文章