CentOS系统安装Redmine
# 简介
Redmine 是一个灵活的项目管理 Web 应用程序。使用 Ruby on Rails 框架编写,它是跨平台和跨数据库的。
Redmine 的一些主要功能是:
多项目支持
灵活的基于角色的访问控制
灵活的问题跟踪系统
甘特图和日历
新闻、文件和档案管理
提要和电子邮件通知
每个项目维基
每个项目论坛
时间跟踪
问题、时间条目、项目和用户的自定义字段
SCM 集成(SVN、CVS、Git、Mercurial 和 Bazaar)
通过电子邮件创建问题
多个LDAP 身份验证支持
用户自行注册支持
多语言支持
多数据库支持
官网地址:https://www.redmine.org
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 安装步骤
# 系统版本
[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
1
2
2
# 运行环境
Redmine 4.0.6 之前的版本支持 Ruby >= 2.2.2。Redmine 4.0.6 及更高版本不支持 Ruby 2.2。
支持的数据库后端:
MySQL 5.5 - 5.7
Redmine 3.x 也支持 MySQL 5.0 和 5.1
PostgreSQL 9.2 或更高版本
确保您的数据库日期样式设置为 ISO(Postgresql 默认设置)。您可以使用以下方法进行设置:ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";
Redmine 3.x 还支持 PostgreSQL 8.3 - 9.1。
Microsoft SQL Server 2012 或更高版本
截至 2018 年 12 月,Redmine 4.0 不支持 SQL Server,因为依赖库activerecord-sqlserver-adapter尚不支持 Rails 5.2。
SQLite 3(不适用于多用户生产使用!)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 安装ruby源
[root@localhost ~]# yum install centos-release-scl-rh
[root@localhost ~]# yum install rh-ruby23 -y
[root@localhost ~]# scl enable rh-ruby23 bash
[root@localhost ~]# ruby -v
1
2
3
4
2
3
4
# 执行命令
# Install Redmine 3.4.2 on Centos 7
# Based on http://www.redmine.org/projects/redmine/wiki/RedmineInstall/273
# mariadb-server as database
# Puma as webserver
# Apache as reverse proxy
# I recommend adding a redmine user first and then using the redmine user to run the service.
# Vagrant uses the user vagrant
# adduser redmine
#provision
#update packages
sudo yum -y update
#redmine needs ruby
#sudo yum -y install ruby
yum install centos-release-scl-rh
yum install rh-ruby23 -y
scl enable rh-ruby23 bash
ruby -v
#mysql
sudo yum -y install mariadb-server
#mysq secure installation recommended
#mysql_secure_installation
#redmine dependencies, c bindings for ruby performance
sudo yum -y install gcc mysql-devel ruby-devel rubygems
#SCM binaries
sudo yum -y install svn git
#ImageMagick
sudo yum -y install ImageMagick
#configure database
#start mysql service
sudo service mariadb start
#enable mysql on startup
sudo systemctl enable mariadb
#create database
sudo mysql -u root -e "CREATE DATABASE redmine CHARACTER SET utf8;"
sudo mysql -u root -e "CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';"
#build
#download redmine using wget from http://www.redmine.org/projects/redmine/wiki/Download
sudo yum -y install wget
wget http://www.redmine.org/releases/redmine-3.2.7.tar.gz
#check md5 2980b80e9acc81c01c06adb86eb4f37d
md5sum redmine-3.2.7.tar.gz
#untar redmine
tar xzfv redmine-3.2.7.tar.gz
#configure database connections
cd redmine-3.2.7/
cp config/database.yml.example config/database.yml
#edit the configuration if needed.
#vi config/database.yml
#redmine uses bundler
sudo gem install bundler
#lib used by bundler to enable imagemagic
sudo yum -y install ImageMagick-devel
#Gemfile.local configured with puma web server and dependencies
cp /vagrant/files/Gemfile.local .
#donwload components and reconfigure the apps
#run every time that we configure the database
/usr/local/bin/bundle install --without development test
#run every time that we configure the database (skips ImageMagic)
#bundle install --without development test rmagick
#Generate session token
/usr/local/bin/bundle exec rake generate_secret_token
#Generate database tables
RAILS_ENV=production /usr/local/bin/bundle exec rake db:migrate
##Load database with test data (if needed)
#export REDMINE_LANG="es"
#RAILS_ENV=production bundle exec rake redmine:load_default_data
#deploy
#create file directories
mkdir -p tmp tmp/pdf public/plugin_assets
cd ..
#move redmine to /opt
sudo mv redmine-3.2.7/ /opt/redmine-3.2.7/
#add symlink
sudo ln -s /opt/redmine-3.2.7 /opt/redmine
#mv files generated outside redmine folder
sudo mv bin/* /opt/redmine/bin
#Configure Redmine
#redmine config
cd /opt/redmine/config
sudo cp configuration.yml.example configuration.yml
#vi configuration.yml
#Webservers
#Example using Webrick testserver
#levanta un server de pruebas para ver que funcione todo en http://10.0.0.19:3000/
#bundle exec rails server webrick -e production
#bundle exec rails server webrick -e production -b 10.0.0.19
#rails server -h
#levantar server puma
#bundle exec puma --environment production
#bundle exec puma --environment production -b tcp://0.0.0.0:9292
#Puma using port 3000
#Configure puma as a service
sudo cp /vagrant/files/puma.service /etc/systemd/system
sudo systemctl daemon-reload
# Enable so it starts on boot
sudo systemctl enable puma.service
# Initial start up
sudo systemctl start puma.service
# Check status
sudo systemctl status puma.service
#Apache as a reverse proxy using port 80
sudo yum -y install httpd
#configuration
sudo cp /vagrant/files/puma-reverseproxy.conf /etc/httpd/conf.d/reverseproxy.conf
#starts service
sudo service httpd start
#enable service on startup
sudo systemctl enable httpd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
上次更新: 2023/09/16, 02:28:15