1
|
|
2
|
**STEP 1**
|
3
|
-Update the system
|
4
|
sudo yum update
|
5
|
|
6
|
|
7
|
**STEP 2**
|
8
|
- Install Dependencies and Database
|
9
|
Add EPEL repository:
|
10
|
sudo dnf install epel-release -y
|
11
|
|
12
|
|
13
|
**STEP 3**
|
14
|
Install development tools and required packages:
|
15
|
sudo dnf groupinstall "Development Tools" -y
|
16
|
|
17
|
|
18
|
**STEP 4**
|
19
|
Install ImageMagick:
|
20
|
sudo dnf install curl git ImageMagick ImageMagick-devel -y
|
21
|
|
22
|
|
23
|
**STEP 5**
|
24
|
---------------------------------
|
25
|
Install MariaDB:
|
26
|
sudo dnf install mariadb mariadb-server
|
27
|
|
28
|
**STEP 6**
|
29
|
After installing MariaDB, start the database server and enable it to start automatically on system boot:
|
30
|
sudo systemctl start mariadb
|
31
|
sudo systemctl enable mariadb
|
32
|
|
33
|
**STEP**
|
34
|
Secure the MariaDB installation:
|
35
|
sudo mysql_secure_installation
|
36
|
|
37
|
**STEP 7**
|
38
|
Create a Database and User for Redmine
|
39
|
sudo mysql -u root -p
|
40
|
|
41
|
# Run the following commands in the MariaDB shell
|
42
|
CREATE DATABASE redmine CHARACTER SET utf8mb4;
|
43
|
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password';
|
44
|
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
|
45
|
FLUSH PRIVILEGES;
|
46
|
EXIT;
|
47
|
------------------------------------------
|
48
|
|
49
|
|
50
|
**STEP 8**
|
51
|
Create a new user and group, with home directory /opt/redmine that will run the Redmine instance:
|
52
|
sudo useradd -m -U -r -d /opt/redmine redmine
|
53
|
|
54
|
|
55
|
**STEP 9**
|
56
|
Install Apache web server by running the following command:
|
57
|
sudo dnf install httpd
|
58
|
|
59
|
Start Apache web server by running the following command:
|
60
|
sudo systemctl start httpd
|
61
|
|
62
|
Enable Apache to start automatically on boot by running the following command:
|
63
|
sudo systemctl enable httpd
|
64
|
|
65
|
To verify that Apache is running, you can run the following command:
|
66
|
sudo systemctl status httpd
|
67
|
|
68
|
|
69
|
**STEP 10**
|
70
|
Add the apache user to the redmine group and change the /opt/redmine directory permissions so that the Apache can access it:
|
71
|
sudo usermod -a -G redmine apache
|
72
|
sudo chmod 750 /opt/redmine
|
73
|
|
74
|
|
75
|
**STEP 11**
|
76
|
Switch to Redmine user:
|
77
|
sudo su - redmine
|
78
|
|
79
|
**STEP 12**
|
80
|
Install RVM: (https://help.dreamhost.com/hc/en-us/articles/217185247-Ruby-Version-Manager-RVM-)
|
81
|
|
82
|
Install RVM's public keys:
|
83
|
gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
|
84
|
|
85
|
Install the latest stable version of RVM:
|
86
|
curl -sSL https://get.rvm.io | bash -s
|
87
|
|
88
|
Run this to unset your GEM_HOME:
|
89
|
unset GEM_HOME
|
90
|
|
91
|
Run this to source your new RVM install:
|
92
|
source ~/.rvm/scripts/rvm
|
93
|
|
94
|
Run the following to disable autolibs:
|
95
|
rvm autolibs disable
|
96
|
|
97
|
Check if RVM is installed and functioning:
|
98
|
rvm --version
|
99
|
|
100
|
|
101
|
**STEP 13**
|
102
|
Install Ruby
|
103
|
Install the exact version of Ruby you require. This example installs version 3.0.1:
|
104
|
rvm install 3.1.0
|
105
|
|
106
|
You can now tell your system to use this version by default:
|
107
|
rvm use 3.1.0 --default
|
108
|
|
109
|
Check the version of Ruby to confirm it's been updated.
|
110
|
ruby -v
|
111
|
|
112
|
|
113
|
**STEP 14**
|
114
|
Install Rails:
|
115
|
|
116
|
Install a specific version:
|
117
|
gem install rails --version 6.1.0
|
118
|
|
119
|
|
120
|
**STEP 15**
|
121
|
Install Redmine 5
|
122
|
curl -L http://www.redmine.org/releases/redmine-5.0.1.tar.gz -o redmine.tar.gz
|
123
|
tar -xvf redmine.tar.gz
|
124
|
mv redmine-5.0.1/ redmine/
|
125
|
rm redmine.tar.gz
|
126
|
|
127
|
|
128
|
**STEP 16**
|
129
|
cp /opt/redmine/redmine/config/database.yml.example /opt/redmine/redmine/config/database.yml
|
130
|
nano /opt/redmine/redmine/config/database.yml
|
131
|
|
132
|
Update:
|
133
|
|
134
|
production:
|
135
|
adapter: mysql2
|
136
|
database: redmine
|
137
|
host: localhost
|
138
|
username: redmine
|
139
|
password: “<redmine db user password>”
|
140
|
encoding: utf8mb4
|
141
|
|
142
|
|
143
|
**STEP 17**
|
144
|
6. Install Ruby Dependencies
|
145
|
cd ~/redmine
|
146
|
WARNING^^
|
147
|
gem install bundler
|
148
|
|
149
|
sudo bundle install --without development test
|
150
|
*WARNING ERROR: An error occurred while installing mysql2 (0.5.5), and Bundler cannot continue.*
|
151
|
|
152
|
|
153
|
bundle exec rake generate_secret_token
|
154
|
RAILS_ENV=production bundle exec rake db:migrate
|
155
|
|
156
|
|
157
|
**STEP 18**
|
158
|
Apache Configuration:
|
159
|
sudo nano /etc/httpd/conf.d/redmine.conf
|
160
|
|
161
|
|
162
|
<VirtualHost *:80>
|
163
|
ServerName example.com _(IP address)_
|
164
|
ServerAlias www.example.com _(IP address)_
|
165
|
DocumentRoot /opt/redmine/redmine/public
|
166
|
|
167
|
<Directory /opt/redmine/redmine-4.1.0/public>
|
168
|
Options Indexes ExecCGI FollowSymLinks
|
169
|
Require all granted
|
170
|
AllowOverride all
|
171
|
</Directory>
|
172
|
|
173
|
ErrorLog /var/log/httpd/example.com-error.log
|
174
|
CustomLog /var/log/httpd/example.com-access.log combined
|
175
|
</VirtualHost>
|
176
|
|
177
|
|
178
|
**STEP 19**
|
179
|
Restart Apache:
|
180
|
$ sudo systemctl restart httpd
|
181
|
|
182
|
|
183
|
|
184
|
|
185
|
|
186
|
|
187
|
|
188
|
|
189
|
|
190
|
|
191
|
|