安装配置Redmine

Author Avatar
双例模式 4月 06, 2020
  • 在其它设备中阅读本文章

安装依赖

  1. Ruby安装,参考这里,通常使用yum安装比较快捷

     sudo yum install ruby
    

当然也可以下载后进行源码安装,下载地址,安装命令为

```bash
# 解压
tar -xvzf ruby-2.6.6.tar.gz
# 安装
cd ruby-2.6.6
./configure
make
sudo make install
```

安装完成后可通过如下命令检查安装情况

```bash
ruby -v
ruby 2.x.x……
```

2.安装Mysql
可以在这里查看Mysql安装过程。

安装配置Redmine

  1. 下载redmine

下载地址:https://www.redmine.org/projects/redmine/wiki/Download
下载后,上传到linux服务器上,解压后进入目录

  1. 安装Gem依赖:

     # 用sudo或者root用户执行
     gem install bundler
     bundle install --without development test
    

    期间如果报mysql2的安装错误,请安装 mysql的客户端client

     rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
     yum search mysql-community
     yum install mysql-community-client.x86_64 -y
    

    或者

     sudo yum install mysql-devel
    
  2. 初始化密钥

     bundle exec rake generate_secret_token
    
  3. 执行数据库初始化脚本

    执行如下脚本将实现数据库表结构的初始化

     RAILS_ENV=production bundle exec rake db:migrate
    

    执行如下脚本将实现数据库数据的初始化

     RAILS_ENV=production bundle exec rake redmine:load_default_data
    
  4. 文件系统权限

     mkdir -p tmp tmp/pdf public/plugin_assets
     sudo chown -R redmine:redmine files log tmp public/plugin_assets
     sudo chmod -R 755 files log tmp public/plugin_assets
    
  5. 使用Webricks测试Redmine

     # 用sudo或者root用户执行
     bundle exec rails server webrick -e production
    
     Note: Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma, hellip;) to serve up your redmine.