CentOS 8上安装和配置Redmine项目管理系统
Redmine是一个免费开源的项目管理和问题跟踪应用程序,它是跨平台和跨数据库的,建立在Ruby on Rails框架之上。 |
实验环境
操作系统:Centos 8
应用:MariaDB + apache + Passenger + Ruby + Redmine
Redmine包括支持多个项目、wiki、问题跟踪系统、论坛、日历、邮件通知等;最近公司项目需要用到Redmine,所以记录下来了。
创建一个MySQL数据库
以root用户登录,执行交互操作
[[email protected]linuxcool ~]# mysql mysql> CREATE DATABASE redmine CHARACTER SET utf8; mysql> GRANT ALL ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'password'; mysql> flush privileges; mysql> exit;
更新dnf源
[[email protected] ~]# dnf install epel-release [[email protected] ~]# dnf config-manager --enable epel
安装httpd
[[email protected] ~]# dnf install httpd
安装ruby
[[email protected] ~]# dnf install ruby
安装Passenger
[[email protected] ~]# dnf install mod_passenger passenger passenger-devel
设置apache开机启动
[[email protected] ~]# systemctl enable httpd
创建redmine系统用户
[[email protected] ~]# useradd -m -U -r -d /opt/redmine redmine
授权
[[email protected] ~]# usermod -a -G redmine apache [[email protected] ~]# chmod 750 /opt/redmine
安装Redmine
[[email protected] ~]# dnf group install "Development Tools" [[email protected] ~]# dnf install zlib-devel curl-devel openssl-devel mariadb-devel ruby-devel
下载Redmine安装包
[[email protected] ~]# curl -L http://www.redmine.org/releases/redmine-4.1.0.tar.gz -o redmine.tar.gz [[email protected] ~]# tar -xvf redmine.tar.gz
配置Redmine
[[email protected] ~]# su - redmine [[email protected] ~]# cp /opt/redmine/redmine-4.1.0/config/database.yml.example /opt/redmine/redmine-4.1.0/config/database.yml [[email protected] ~]# vim /opt/redmine/redmine-4.1.0/config/database.yml production: adapter: mysql2 database: redmine host: localhost username: redmine password: "password" encoding: utf8mb4
安装Ruby dependencies插件
[[email protected] ~]# cd ~/redmine-4.1.0 [[email protected] ~]# gem install bundler --no-rdoc --no-ri [[email protected] ~]# bundle install --without development test postgresql sqlite --path vendor/bundle
生成数据库**
[[email protected] ~]# bundle exec rake generate_secret_token [[email protected] ~]# RAILS_ENV=production bundle exec rake db:migrate
配置apache虚拟主机
[[email protected] ~]# vim /etc/httpd/conf.d/redmine.conf <VirtualHost *:80> ServerName redmine.com ServerAlias www.redmine.com DocumentRoot /opt/redmine/redmine-4.1.0/public <Directory /opt/redmine/redmine-4.1.0/public> Options Indexes ExecCGI FollowSymLinks Require all granted AllowOverride all </Directory> ErrorLog /var/log/httpd/example.com-error.log CustomLog /var/log/httpd/example.com-access.log combined </VirtualHost>
重启httpd服务
[[email protected] ~]# systemctl restart httpd
测试Redmine
也可以通过http://www.redmine.com,但是需要修改hosts文件才可以,否则访问的是redmine官网。
本文原创地址:https://www.linuxprobe.com/centos-install-redmine.html