Project

General

Profile

F29Installation » History » Version 28

Gerd Pokorra, 2019-01-03 16:58

1 1 Gerd Pokorra
h1. HowTo Install Redmine 4.0.0 on Fedora 29
2
3
{{toc}}
4
5
This guide is not complete. It will be completed in the next two weeks.
6
7
h2.  System Requirements
8
9
It is assumed that the Server Edition is installed on the system in this guide.
10
11 13 Gerd Pokorra
h3. Updating the System
12
  
13
It is recommended to install Redmine on an update system. To ensure that all installed packages are up-to-date issue the following command:
14
15
<pre>> dnf update
16
</pre>
17
18 14 Gerd Pokorra
h3. Installing Dependencies
19
20
A number of dependencies need to be installed:
21
22
<pre>> dnf install rubygem-bundler
23
> dnf install rubygem-rails
24
25
> dnf install ruby-devel rubygem-rmagick
26
> dnf install gcc redhat-rpm-config
27
28
> dnf groupinstall "C Development Tools and Libraries"
29
> dnf groupinstall "Development Tools"
30
</pre>
31
32 28 Gerd Pokorra
Database adapter for PostgreSQL:
33 16 Gerd Pokorra
  
34 1 Gerd Pokorra
<pre>> dnf install rubygem-pg
35
</pre>
36 17 Gerd Pokorra
37 28 Gerd Pokorra
Database adapter for MySQL:
38 27 Gerd Pokorra
<pre>> dnf install rubygem-mysql2
39
</pre>
40
41 17 Gerd Pokorra
The list of dependencies may not complete. Problems of the installation or build of a compoment can be solved by installing the necessary dependency.
42 16 Gerd Pokorra
43 12 Gerd Pokorra
h2. Obtaining Redmine (Step 1)
44
45
Get the Redmine source code by downloading the packaged release.
46
47
<pre>> dnf install wget
48
49
> mkdir /var/www
50
> cd /var/www
51
52
> wget http://www.redmine.org/releases/redmine-4.0.0.tar.gz
53
> tar xf redmine-4.0.0.tar.gz
54
</pre>
55
56
At this guide is accepted that the location of the Redmine source code is:
57
58
<pre>/var/www/redmine-4.0.0
59
</pre>
60
61
For example the nginx configuration refer to the path @/var/www/redmine-4.0.0@.
62 16 Gerd Pokorra
63 22 Gerd Pokorra
h2. Setup a local database server (Step 2)
64 16 Gerd Pokorra
65
This section discribes the setup of a database server that will be configured to allow access from the localhost.
66
67
h3. PostgreSQL
68
69 18 Gerd Pokorra
The followings commands are for installing the packages, initializing the database, enable and start the postgresql server, switch the user to interact with @postgres@, create an empty database and accompanying user.
70
71
<pre>> dnf install postgresql-server postgresql-contrib
72
> postgresql-setup --initdb --unit postgresql
73
 * Initializing database in '/var/lib/pgsql/data'
74
 * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
75
>
76
> systemctl enable postgresql
77
> systemctl start postgresql
78
> su - postgres
79
> psql
80
psql (10.6)
81
Type "help" for help.
82
83
postgres=# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_secret' NOINHERIT VALID UNTIL 'infinity';
84
CREATE ROLE
85
postgres=# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
86
CREATE DATABASE
87
postgres=# \q
88
> exit
89
</pre>
90
91 19 Gerd Pokorra
Edit the file @/var/lib/pgsql/data/pg_hba.conf@ to specify that the client has to supply password processed with MD5 algorithm:
92
93
<pre>#host    all             all             127.0.0.1/32            ident
94
host    all             all             127.0.0.1/32            md5
95
# IPv6 local connections:
96
#host    all             all             ::1/128                 ident
97
host    all             all             ::1/128                 md5
98
</pre>
99
100
You can check the access with the following command:
101
102
<pre>> su - postgres
103 20 Gerd Pokorra
> psql -h localhost -U redmine redmine
104 1 Gerd Pokorra
</pre>
105 20 Gerd Pokorra
106
The appropriate Redmine database configuration file for local access is:
107
108 21 Gerd Pokorra
<pre>> cat /var/www/redmine-4.0.0/config/database.yml
109 20 Gerd Pokorra
# PostgreSQL configuration
110
production:
111
  adapter: postgresql
112
  database: redmine
113
  host: localhost
114
  username: redmine
115
  password: "my_secret"
116
  encoding: utf8
117 1 Gerd Pokorra
  schema_search_path: public
118 21 Gerd Pokorra
</pre>
119 20 Gerd Pokorra
120
If you want to use IPv4 you have to specify @localhost4@ as hostname.
121 19 Gerd Pokorra
122 1 Gerd Pokorra
h3. MySQL
123 22 Gerd Pokorra
124
Install the MySQL repositry
125
126
<pre>> dnf -y install https://dev.mysql.com/get/mysql80-community-release-fc29-1.noarch.rpm
127
</pre>
128
129
If you prefer to stick to MySQL 5.7
130
131
<pre>> dnf config-manager --set-enabled mysql57-community
132
> dnf config-manager --set-disabled mysql80-community
133
</pre>
134
135 23 Gerd Pokorra
Install the MySQL server package, start the MySQL server and autostart the daemon on boot
136
137 22 Gerd Pokorra
<pre>> dnf -y install mysql-community-server
138
> systemctl start mysqld.service
139
> systemctl enable mysqld.service
140
</pre>
141 12 Gerd Pokorra
142 24 Gerd Pokorra
Get your generated random root password you will need it at the next step.
143
144
<pre>> grep 'A temporary password is generated for root@localhost' /var/log/mysqld.log |tail -1
145
</pre>
146
147
Start the secure installation assistant to
148
149 25 Gerd Pokorra
* change root password
150
* remove anonymous users
151
* disallow root login remotely
152
* remove test database and access to it
153
* reload privilege tables
154 24 Gerd Pokorra
155
<pre>> mysql_secure_installation
156
</pre>
157
158 26 Gerd Pokorra
Creation of user and database for Redmine
159
160
<pre>> mysql -h localhost -u root -p
161
Enter password:
162
...
163
mysql> CREATE DATABASE redmine CHARACTER SET utf8mb4;
164
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_secret';
165
mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
166
mysql> \q
167
</pre>
168
169 11 Gerd Pokorra
h2. Firewall
170
171
Open the firewall for https:
172
173
<pre>> firewall-cmd --add-service=https
174
> firewall-cmd --permanent --add-service=https
175
</pre>
176
177 1 Gerd Pokorra
h2. Web Server
178
179 5 Gerd Pokorra
h3. Nginx/Passenger
180 2 Gerd Pokorra
181
The Fedora @nginx@ package do not include Passenger, so you have to build @nginx@ with the passenger module. The guide assume that the sources are extracted under the directory @/opt@ . The @nginx@ software will be installed at @/opt/ngnix@. At the time of writting that guide this was the current stable releases of @passenger@ and @nginx@:
182
183
* passenger-6.0.0
184
* nginx-1.14.2
185
186 4 Gerd Pokorra
h4. Downloading the sources:
187 2 Gerd Pokorra
188
<pre>Passenger
189
190
> cd /opt
191
> wget https://s3.amazonaws.com/phusion-passenger/releases/passenger-6.0.0.tar.gz
192
> tar xf passenger-6.0.0.tar.gz
193
194
Nginx
195
196
> wget http://nginx.org/download/nginx-1.14.2.tar.gz
197
> mkdir /opt/src
198
> cd /opt/src
199
> tar xf nginx-1.14.2.tar.gz
200
</pre>
201 1 Gerd Pokorra
202 3 Gerd Pokorra
h4. Installing additional packages
203
204
For the build of @passenger@ and @nginx@ the following additional packages are needed to be installed:
205
206
<pre>> dnf install install gcc-c++ libcurl-devel openssl-devel zlib-devel
207
</pre>
208 1 Gerd Pokorra
209 5 Gerd Pokorra
h4. Execute the ruby script for building and installing
210 1 Gerd Pokorra
211 5 Gerd Pokorra
The simplest way to build and install the @nginx@ web server with the @passenger@ module is to run the script @passenger-install-nginx-module@.
212
213
<pre>> /opt/passenger-6.0.0/bin
214
> ./passenger-install-nginx-module --prefix=/opt/nginx --nginx-source-dir=/opt/src/nginx-1.14.2 --languages ruby
215
</pre>
216 3 Gerd Pokorra
217 7 Gerd Pokorra
With the same @passenger@ locality the installer modify the @nginx@ configuration file @/opt/nginx/conf/nginx.conf@ and output the same text:
218 6 Gerd Pokorra
219
<pre>  http {
220
      ...
221
      passenger_root /opt/passenger-6.0.0;
222
      passenger_ruby /usr/bin/ruby;
223
      ...
224
  }
225
</pre>
226
227 8 Gerd Pokorra
h4. Add a systemd service file
228
229
To start the @nginx@ process during the boot add the file @/usr/lib/systemd/system/nginx.service@ with the following content:
230
231
<pre>[Unit]
232
Description=The nginx HTTP and reverse proxy server
233
After=network.target remote-fs.target nss-lookup.target
234
235
[Service]
236
Type=forking
237
#PIDFile=/run/nginx.pid
238
PIDFile=/opt/nginx/logs/nginx.pid
239
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
240
# SELinux context. This might happen when running `nginx -t` from the cmdline.
241
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
242
ExecStartPre=/usr/bin/rm -f /opt/nginx/logs/nginx.pid
243
#ExecStartPre=/usr/sbin/nginx -t
244
#ExecStart=/usr/sbin/nginx
245
ExecStartPre=/opt/nginx/sbin/nginx -t
246
ExecStart=/opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf
247
ExecReload=/bin/kill -s HUP $MAINPID
248
KillSignal=SIGQUIT
249
TimeoutStopSec=5
250
KillMode=mixed
251
PrivateTmp=true
252
253
[Install]
254
WantedBy=multi-user.target
255
</pre>
256
257
The paths are modified to start the executable @/opt/nginx/sbin/nginx@.
258
259
<pre>> systemctl start nginx
260
> systemctl enable nginx
261
</pre>
262
263 9 Gerd Pokorra
h4. Nginx Configuration
264
265
For http add the two lines and comment out the four lines:
266
267
<pre>    server {
268
        listen       80;
269
...
270
        root         /var/www/redmine-4.0.0/public;
271
        passenger_enabled on;
272
        #location / {
273
        #    root   html;
274
        #    index  index.html index.htm;
275
        #}
276
...
277
       }
278
</pre>
279
280 10 Gerd Pokorra
For https add you can use lines like this:
281
282
<pre>    # HTTPS server
283
    #
284
    server {
285
        listen       443 ssl;
286
        server_name  my_web_serv.domain;
287
288
        ssl_certificate      /etc/ssl/certs/my_web_serv.pem;
289
        ssl_certificate_key  /etc/ssl/private/privkey.pem;
290
291
        root         /var/www/redmine-4.0.0/public;
292
        passenger_enabled on;
293
    }
294
</pre>
295
296 1 Gerd Pokorra
h3. Apache