F29Installation » History » Version 22

Gerd Pokorra, 2019-01-03 10:04

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