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

  1. 安装软件环境
    # 安装 OpenSSL支持环境
    yum install openssl openssl-dev
    
    # 安装 Ruby
    tar zxf ruby-1.8.7-p371.tar.gz
    cd ruby-1.8.7-p371
    ./configure --prefix=/usr
    make
    make install
    
    # 确认版本信息: ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]
    ruby -v
    
    # 安装 rubygems
    tar zxf rubygems-1.8.24.tgz
    cd rubygems-1.8.24
    ruby setup.rb
    
    # 在线安装其他组件, 组件太多请勿尝试手动安装
    tar zxf redmine-2.1.4.tar.gz -C /usr/local/
    cd /usr/local/redmine-2.1.4
    gem install bundler
    bundle install --without development test postgresql sqlite rmagick
    gem install tlsmail

  2. 创建数据库帐号
    # Mysql
    create database redmine character set utf8;
    grant all privileges on redmine.* to redmine@'%' identified by '123456';
  3. 修改配置文件
    # vim /usr/local/redmine-2.1.4/config/database.yml
    
    # MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
    #
    # Get the fast C bindings:
    #   gem install mysql
    #   (on OS X: gem install mysql -- --include=/usr/local/lib)
    # And be sure to use new-style password hashing:
    #   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
    
    production:
      adapter: mysql
      database: redmine
      host: localhost
      port: 3306
      username: redmine
      password: 123456
      encoding: utf8
  4. 安装redmine
    # 以下为命令界面执行的命令
    
    cd /usr/local/redmine-2.1.4
    
    rake generate_secret_token
    RAILS_ENV=production rake db:migrate
    RAILS_ENV=production rake redmine:load_default_data
    
    mkdir tmp public/plugin_assets
    chown -R redmine:redmine files log tmp public/plugin_assets
    chmod -R 755 files log tmp public/plugin_assets
    
    # 启动
    
    cd /usr/local/redmine-2.1.4
    ruby script/rails server webrick -e production -p 3002 &
    
    # 此时可通过浏览器访问,帐号admin 密码admin

  1. Nginx 反向代理配置
    # 增加 Nginx Proxy 后能很大程度上给 redmine 提速
    
    gzip  on;
    gzip_proxied any;
    gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/json;
    proxy_cache_path cache levels=1:2 keys_zone=redmine:256m inactive=60m max_size=4g;
    
    server {
        listen       3000;
        server_name  localhost;
        access_log   off;
        location / {
            proxy_cache redmine;
            proxy_cache_valid 200 304 1m;
            proxy_pass  http://backend;
            index  index.html index.htm;
        }
    }
    upstream backend {
            server   127.0.0.1:3002;
    }

  1. 邮件配置及 Gmail SSL 支持
    # vim /usr/local/redmine-2.1.4/config/email.yml
    
    # Outgoing email settings
    production:
      delivery_method: :async_smtp
      smtp_settings:
        enable_starttls_auto: true
        address: smtp.gmail.com
        port: 587
        domain: gmail.com
        authentication: :login
        user_name: ping.bao.cn@gmail.com
        password: redmine123456
        tls: true
    
    # Gmail tls_mail Trouble Shootting ......
    
    cd /usr/local/lib/ruby/gems/1.9/gems/tlsmail-0.0.1/lib/
    cp * /usr/local/redmine-2.1.4/lib/redmine/ -r
    vim /usr/local/redmine-2.1.4/lib/redmine/net/smtp.rb
    
    class SMTP
    
       Revision = %q$Revision: 10709 $.split[1]
    
       # The default SMTP port, port 25.
       def SMTP.default_port
         25
       end
    
       @use_tls = true
       @verify = nil
       @certs = nil
    
       def SMTP.enable_tls(verify = OpenSSL::SSL::VERIFY_PEER, certs = nil)
         @use_tls = true
         @verify = verify
         @certs = certs
       end
    
       def initialize(address, port = nil)
         @address = address
         @port = (port || SMTP.default_port)
         @esmtp = true
         @socket = nil
         @started = false
         @open_timeout = 30
         @read_timeout = 60
         @error_occured = false
         @debug_output = nil
         @use_tls = SMTP.use_tls?
         @certs = SMTP.certs
         @verify = SMTP.verify
       end

转载于:https://my.oschina.net/dinga/blog/94233

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值