FedoraInstallation » History » Version 4
Jamie McPeek, 2014-08-16 22:36
1 | 1 | Jamie McPeek | h1. HowTo Install Redmine 2.5.x on Fedora 20 |
---|---|---|---|
2 | |||
3 | {{toc}} |
||
4 | |||
5 | h2. System Requirements |
||
6 | |||
7 | No assumptions are made about the initial state of the system in this guide. The guide can be followed for either 32-bit or 64-bit systems - though all testing and the original installation was performed on a 64-bit system. |
||
8 | |||
9 | The hardware requirements are not significant, so a small VM with 10gb storage and 1GB ram and 1GB swap file should be sufficient. |
||
10 | |||
11 | This guide can be used on top of an already existing system or, from scratch, downloading from the Fedora website. |
||
12 | |||
13 | An ISO for installation can be downloaded from "here":http://fedoraproject.org/en/get-fedora. |
||
14 | |||
15 | The rest of the guide assumes that you have created a user account with wheel/administrator access and are logged in to the terminal directly or through SSH. |
||
16 | 2 | Jamie McPeek | |
17 | h2. Updating the System |
||
18 | |||
19 | Before beginning, you should ensure all of your installed packages are up-to-date. This can be done by issuing the following command: |
||
20 | |||
21 | <pre> |
||
22 | $ sudo yum update |
||
23 | </pre> |
||
24 | |||
25 | If the kernel was updated as part of this command, you should perform a restart to begin using it: |
||
26 | |||
27 | <pre> |
||
28 | $ sudo shutdown -r now |
||
29 | </pre> |
||
30 | |||
31 | h2. Installing Dependencies |
||
32 | 3 | Jamie McPeek | |
33 | Before beginning the installation of Redmine, there are a number of dependencies which need to be installed. |
||
34 | |||
35 | 4 | Jamie McPeek | Depending on your needs, some of these may not be necessary. Depending on your preferences, you may choose alternatives to some of these. |
36 | 3 | Jamie McPeek | |
37 | <pre> |
||
38 | apr-devel - For Passenger |
||
39 | apr-util-devel - For Passenger |
||
40 | curl-devel - For Passenger |
||
41 | gcc - For JSON |
||
42 | gcc-c++ - For Passenger |
||
43 | git - (Optional) For SCM Integration |
||
44 | httpd - Web Server |
||
45 | httpd-devel - For Passenger |
||
46 | ImageMagick-devel - For RMagick |
||
47 | mariadb-devel - For Redmine |
||
48 | mariadb-server - For Redmine |
||
49 | nano - Configuration Editor |
||
50 | ruby-devel - For Redmine |
||
51 | tar - For Decompression |
||
52 | wget - For Download |
||
53 | </pre> |
||
54 | |||
55 | All of these can be installed prior to starting with a single command: |
||
56 | |||
57 | <pre> |
||
58 | $ sudo yum install apr-devel apr-util-devel curl-devel gcc gcc-c++ git httpd httpd-devel ImageMagick-devel mariadb-devel mariadb-server nano ruby-devel tar wget |
||
59 | </pre> |
||
60 | |||
61 | h2. Disable SELinux |
||
62 | |||
63 | Some users have noted issues installing Redmine with SELinux active. This can be disabled via the following command: |
||
64 | |||
65 | <pre> |
||
66 | # sudo setenforce 0 |
||
67 | </pre> |
||
68 | |||
69 | Steps will be taken throughout the remainder of the guide to ensure that, if desired, SELinux can be re-enabled after and still maintain a fully functional Redmine installation. |
||
70 | |||
71 | h2. Enable Server Environment |
||
72 | |||
73 | With all of the dependencies installed, we need to ensure that the servers are setup, ready for use, and accessible external to the OS installation. |
||
74 | |||
75 | The first step is to open the standard port 80 in the firewall for the web server: |
||
76 | |||
77 | <pre> |
||
78 | $ sudo firewall-cmd --zone=public --add-service=http |
||
79 | $ sudo firewall-cmd --permanent --zone=public --add-service=http |
||
80 | </pre> |
||
81 | |||
82 | The first line opens the port in the current configuration. The second line ensures that, after a restart, that port will remain open and available. |
||
83 | |||
84 | The second step is to start the web server and database server: |
||
85 | |||
86 | <pre> |
||
87 | $ sudo systemctl start httpd mariadb |
||
88 | $ sudo systemctl enable httpd mariadb |
||
89 | </pre> |
||
90 | |||
91 | 1 | Jamie McPeek | Similar to the firewall commands, the first line starts the servers in the current configuration. The second line ensures that, after a restart, both servers come back online. |
92 | 4 | Jamie McPeek | |
93 | h2. Configuring MariaDB |
||
94 | |||
95 | Now that you have a database server up and running, it needs to be configured for use. The initial setup can be performed with the following command: |
||
96 | |||
97 | <pre> |
||
98 | $ mysql_secure_installation |
||
99 | </pre> |
||
100 | |||
101 | This will prompt you to create a password for the root account as well as a number of other choices. For a standard setup, the default choice for each question is acceptable. |
||
102 | |||
103 | Advanced usages or installations may opt for different answers; however, that is beyond the scope of this guide. |
||
104 | |||
105 | h3. Creating a Redmine Database and Account |
||
106 | |||
107 | Now that you have MariaDB configured, it is time to create a database and user for use with your Redmine installation. |
||
108 | |||
109 | First, connect to the server: |
||
110 | |||
111 | <pre> |
||
112 | $ mysql -u root -p |
||
113 | </pre> |
||
114 | |||
115 | You will be prompted to enter the root password. Once provided, you will be able to issue the following commands: |
||
116 | |||
117 | <pre><code class="sql"> |
||
118 | CREATE DATABASE redmine CHARACTER SET utf8; |
||
119 | CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<user_password>'; |
||
120 | GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; |
||
121 | </code></pre> |
||
122 | |||
123 | The above commands will create the database, create a user with a defined password, and ensure the created user has full access on the newly created database. |
||
124 | |||
125 | Once those commands have been entered, issue the following command to return to the command line: |
||
126 | |||
127 | <pre> |
||
128 | quit |
||
129 | </pre> |
||
130 | |||
131 | h2. Obtaining Redmine |
||
132 | |||
133 | Now that all the dependencies are installed and the servers are up and running it's time to get the stable release of Redmine and begin its installation. |
||
134 | |||
135 | In this example, we'll use wget to download the file from the Redmine server and tar to extract its contents: |
||
136 | |||
137 | <pre> |
||
138 | $ wget http://www.redmine.org/releases/redmine-2.5.2.tar.gz |
||
139 | $ tar xfzv redmine-2.5.2.tar.gz |
||
140 | </pre> |
||
141 | |||
142 | h2. Redmine Database Configuration |
||
143 | |||
144 | To ensure proper functionality, the Redmine installation will need to communicate with the database that has just been created. This can be done by performing the following: |
||
145 | |||
146 | <pre> |
||
147 | $ cd redmine-2.5.2/config |
||
148 | $ cp database.yml.example database.yml |
||
149 | $ nano -w database.yml |
||
150 | </pre> |
||
151 | |||
152 | Once the file has been opened, the @production@ definition needs to be updated to match the database and account used above. It should look as follows: |
||
153 | |||
154 | <pre><code class="yaml"> |
||
155 | production: |
||
156 | adapter: mysql2 |
||
157 | database: redmine |
||
158 | host: localhost |
||
159 | username: redmine |
||
160 | password: "<user_password>" |
||
161 | encoding: utf8 |
||
162 | </code></pre> |
||
163 | |||
164 | This replaces the user @root@ and the blank password in the example configuration file. |
||
165 | |||
166 | h2. Redmine Installation Directory |
||
167 | |||
168 | With most of the precursor work completed, it's time to move the installation to a folder more accessible than a user's home directory. |
||
169 | |||
170 | For the purposes of this guide, Redmine will be moved to @/var/www/redmine@; however, this could be moved to a variety of over locations based on personal needs. |
||
171 | |||
172 | This can be don with the following commands: |
||
173 | |||
174 | <pre> |
||
175 | $ cd /var/www |
||
176 | $ sudo cp -R ~/redmine-2.5.2 redmine |
||
177 | $ cd redmine |
||
178 | </pre> |
||
179 | |||
180 | To ensure proper functionality and access rights, the @public/plugin_assets@ folder needs to be created: |
||
181 | |||
182 | <pre> |
||
183 | $ sudo mkdir public/plugin_assets |
||
184 | </pre> |
||
185 | |||
186 | To allow read/write access to the folders, the user @apache@ needs to have access: |
||
187 | |||
188 | <pre> |
||
189 | $ sudo chown apache:apache -R files log public/plugin_assets tmp |
||
190 | </pre> |
||
191 | |||
192 | h3. Optional SELinux Configuration |
||
193 | |||
194 | If you plan to re-enable SELinux after installation, the following steps should be taken to ensure smooth execution. |
||
195 | |||
196 | <pre> |
||
197 | $ sudo chcon -R --reference=/var/www/html /var/www/redmine |
||
198 | </pre> |
||
199 | |||
200 | This command applies SELinux directory permissions typically for a web server to all sub-directories under the redmine top-level folder. |
||
201 | |||
202 | <pre> |
||
203 | $ sudo chcon -t httpd_sys_content_rw_t -R files log public/plugin_assets tmp |
||
204 | </pre> |
||
205 | |||
206 | This command enables the specific folders listed to have read/write access while SELinux is active. Under a normal configuration with SELinux, all web directories are read-only. |