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