F29Installation » History » Version 17

Gerd Pokorra, 2019-01-01 11:56

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 16 Gerd Pokorra
h2. Setup a local database server
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 16 Gerd Pokorra
h3. MySQL
66 12 Gerd Pokorra
67 11 Gerd Pokorra
h2. Firewall
68 11 Gerd Pokorra
69 11 Gerd Pokorra
Open the firewall for https:
70 11 Gerd Pokorra
71 11 Gerd Pokorra
<pre>> firewall-cmd --add-service=https
72 11 Gerd Pokorra
> firewall-cmd --permanent --add-service=https
73 11 Gerd Pokorra
</pre>
74 11 Gerd Pokorra
75 1 Gerd Pokorra
h2. Web Server
76 1 Gerd Pokorra
77 5 Gerd Pokorra
h3. Nginx/Passenger
78 2 Gerd Pokorra
79 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@:
80 2 Gerd Pokorra
81 2 Gerd Pokorra
* passenger-6.0.0
82 2 Gerd Pokorra
* nginx-1.14.2
83 2 Gerd Pokorra
84 4 Gerd Pokorra
h4. Downloading the sources:
85 2 Gerd Pokorra
86 2 Gerd Pokorra
<pre>Passenger
87 2 Gerd Pokorra
88 2 Gerd Pokorra
> cd /opt
89 2 Gerd Pokorra
> wget https://s3.amazonaws.com/phusion-passenger/releases/passenger-6.0.0.tar.gz
90 2 Gerd Pokorra
> tar xf passenger-6.0.0.tar.gz
91 2 Gerd Pokorra
92 2 Gerd Pokorra
Nginx
93 2 Gerd Pokorra
94 2 Gerd Pokorra
> wget http://nginx.org/download/nginx-1.14.2.tar.gz
95 2 Gerd Pokorra
> mkdir /opt/src
96 2 Gerd Pokorra
> cd /opt/src
97 2 Gerd Pokorra
> tar xf nginx-1.14.2.tar.gz
98 2 Gerd Pokorra
</pre>
99 1 Gerd Pokorra
100 3 Gerd Pokorra
h4. Installing additional packages
101 3 Gerd Pokorra
102 3 Gerd Pokorra
For the build of @passenger@ and @nginx@ the following additional packages are needed to be installed:
103 3 Gerd Pokorra
104 3 Gerd Pokorra
<pre>> dnf install install gcc-c++ libcurl-devel openssl-devel zlib-devel
105 3 Gerd Pokorra
</pre>
106 1 Gerd Pokorra
107 5 Gerd Pokorra
h4. Execute the ruby script for building and installing
108 1 Gerd Pokorra
109 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@.
110 5 Gerd Pokorra
111 5 Gerd Pokorra
<pre>> /opt/passenger-6.0.0/bin
112 5 Gerd Pokorra
> ./passenger-install-nginx-module --prefix=/opt/nginx --nginx-source-dir=/opt/src/nginx-1.14.2 --languages ruby
113 5 Gerd Pokorra
</pre>
114 3 Gerd Pokorra
115 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:
116 6 Gerd Pokorra
117 6 Gerd Pokorra
<pre>  http {
118 6 Gerd Pokorra
      ...
119 6 Gerd Pokorra
      passenger_root /opt/passenger-6.0.0;
120 6 Gerd Pokorra
      passenger_ruby /usr/bin/ruby;
121 6 Gerd Pokorra
      ...
122 6 Gerd Pokorra
  }
123 6 Gerd Pokorra
</pre>
124 6 Gerd Pokorra
125 8 Gerd Pokorra
h4. Add a systemd service file
126 8 Gerd Pokorra
127 8 Gerd Pokorra
To start the @nginx@ process during the boot add the file @/usr/lib/systemd/system/nginx.service@ with the following content:
128 8 Gerd Pokorra
129 8 Gerd Pokorra
<pre>[Unit]
130 8 Gerd Pokorra
Description=The nginx HTTP and reverse proxy server
131 8 Gerd Pokorra
After=network.target remote-fs.target nss-lookup.target
132 8 Gerd Pokorra
133 8 Gerd Pokorra
[Service]
134 8 Gerd Pokorra
Type=forking
135 8 Gerd Pokorra
#PIDFile=/run/nginx.pid
136 8 Gerd Pokorra
PIDFile=/opt/nginx/logs/nginx.pid
137 8 Gerd Pokorra
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
138 8 Gerd Pokorra
# SELinux context. This might happen when running `nginx -t` from the cmdline.
139 8 Gerd Pokorra
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
140 8 Gerd Pokorra
ExecStartPre=/usr/bin/rm -f /opt/nginx/logs/nginx.pid
141 8 Gerd Pokorra
#ExecStartPre=/usr/sbin/nginx -t
142 8 Gerd Pokorra
#ExecStart=/usr/sbin/nginx
143 8 Gerd Pokorra
ExecStartPre=/opt/nginx/sbin/nginx -t
144 8 Gerd Pokorra
ExecStart=/opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf
145 8 Gerd Pokorra
ExecReload=/bin/kill -s HUP $MAINPID
146 8 Gerd Pokorra
KillSignal=SIGQUIT
147 8 Gerd Pokorra
TimeoutStopSec=5
148 8 Gerd Pokorra
KillMode=mixed
149 8 Gerd Pokorra
PrivateTmp=true
150 8 Gerd Pokorra
151 8 Gerd Pokorra
[Install]
152 8 Gerd Pokorra
WantedBy=multi-user.target
153 8 Gerd Pokorra
</pre>
154 8 Gerd Pokorra
155 8 Gerd Pokorra
The paths are modified to start the executable @/opt/nginx/sbin/nginx@.
156 8 Gerd Pokorra
157 8 Gerd Pokorra
<pre>> systemctl start nginx
158 8 Gerd Pokorra
> systemctl enable nginx
159 8 Gerd Pokorra
</pre>
160 8 Gerd Pokorra
161 9 Gerd Pokorra
h4. Nginx Configuration
162 9 Gerd Pokorra
163 9 Gerd Pokorra
For http add the two lines and comment out the four lines:
164 9 Gerd Pokorra
165 9 Gerd Pokorra
<pre>    server {
166 9 Gerd Pokorra
        listen       80;
167 9 Gerd Pokorra
...
168 9 Gerd Pokorra
        root         /var/www/redmine-4.0.0/public;
169 9 Gerd Pokorra
        passenger_enabled on;
170 9 Gerd Pokorra
        #location / {
171 9 Gerd Pokorra
        #    root   html;
172 9 Gerd Pokorra
        #    index  index.html index.htm;
173 9 Gerd Pokorra
        #}
174 9 Gerd Pokorra
...
175 9 Gerd Pokorra
       }
176 9 Gerd Pokorra
</pre>
177 9 Gerd Pokorra
178 10 Gerd Pokorra
For https add you can use lines like this:
179 10 Gerd Pokorra
180 10 Gerd Pokorra
<pre>    # HTTPS server
181 10 Gerd Pokorra
    #
182 10 Gerd Pokorra
    server {
183 10 Gerd Pokorra
        listen       443 ssl;
184 10 Gerd Pokorra
        server_name  my_web_serv.domain;
185 10 Gerd Pokorra
186 10 Gerd Pokorra
        ssl_certificate      /etc/ssl/certs/my_web_serv.pem;
187 10 Gerd Pokorra
        ssl_certificate_key  /etc/ssl/private/privkey.pem;
188 10 Gerd Pokorra
189 10 Gerd Pokorra
        root         /var/www/redmine-4.0.0/public;
190 10 Gerd Pokorra
        passenger_enabled on;
191 10 Gerd Pokorra
    }
192 10 Gerd Pokorra
</pre>
193 10 Gerd Pokorra
194 1 Gerd Pokorra
h3. Apache