Install Redmine 25x on Centos 65 complete » History » Version 3

Mr. DTTH, 2014-06-25 15:50

1 1 Mr. DTTH
h1. Install Redmine on Centos 6.5 - 64 bit
2 1 Mr. DTTH
3 1 Mr. DTTH
{{toc}}
4 1 Mr. DTTH
5 1 Mr. DTTH
You can "download":http://www.mediafire.com/download/68d5odq68ldwoua/RedmineV250CentosEnglish.zip this document as ebook format, read with the "eReader":http://edesignnetwork.org/projects/ibooks program.
6 3 Mr. DTTH
7 3 Mr. DTTH
Origin source from : "eDesignNetwork.org":http://edesignnetwork.org/project/it_projects/it_projects_rubyonrails/redmineplusplus or "Wiki : Install Redmine":http://edesignnetwork.org/projects/redmineplusplus/wiki/Install_Redmine
8 1 Mr. DTTH
9 1 Mr. DTTH
h2. The System Requirements
10 1 Mr. DTTH
11 1 Mr. DTTH
During the installation process we will use the Centos 6.5 - 64 bit OS, the original hardware configuration should not require high you can install on a normal PC or a virtual machine using VMWare, VirtualBox.
12 1 Mr. DTTH
13 1 Mr. DTTH
For the CentOS operating system, you can downloading at URL address :
14 1 Mr. DTTH
15 1 Mr. DTTH
http://centos.org/download
16 1 Mr. DTTH
17 1 Mr. DTTH
!{width: 80%}DownloadCentos.png!
18 1 Mr. DTTH
 
19 1 Mr. DTTH
Selecting a 64-bit version called "CentOS-6.5-x86_64-bin-DVD1.iso", after you download and install on the computer or on a virtual machine, the installation process is simple for anyone with basic computer skills.
20 1 Mr. DTTH
21 1 Mr. DTTH
Although this guiding document install on the Centos 6.5 operating system, but you can use any version of Centos 6.x for both 32 bit and 64 bit.
22 1 Mr. DTTH
23 1 Mr. DTTH
When the installation process is complete, you need the tools to connect with the Centos server via FTP and SSH protocols, you must to install FileZilla at the URL address :
24 1 Mr. DTTH
25 1 Mr. DTTH
https://filezilla-project.org/download.php
26 1 Mr. DTTH
 
27 1 Mr. DTTH
Next, we need to install Putty to communicate with Linux via SSH.
28 1 Mr. DTTH
 
29 1 Mr. DTTH
Download the installation package Putty for Windows at the following address :
30 1 Mr. DTTH
31 1 Mr. DTTH
http://www.putty.org/
32 1 Mr. DTTH
33 1 Mr. DTTH
To prepare for the next section, you need to set up a connection using Putty SSH to Server running Centos, enter the IP address of the computer running Centos (probably IP on the dedicated server, on the virtual machines, on the your LAN or PC).
34 1 Mr. DTTH
35 1 Mr. DTTH
!ConnectPutty.png!
36 1 Mr. DTTH
 
37 1 Mr. DTTH
After setting up SSH connection successful, we will move on to step installing the system.
38 1 Mr. DTTH
39 1 Mr. DTTH
!ConnectCentosOK.png!
40 1 Mr. DTTH
41 1 Mr. DTTH
h2. Update the System
42 1 Mr. DTTH
43 1 Mr. DTTH
For convenience in the next section, we follow the way :
44 1 Mr. DTTH
45 1 Mr. DTTH
* Select and copy command (CTRL + C)
46 1 Mr. DTTH
47 1 Mr. DTTH
* Right-click into the Putty window to Paste command and press Enter to execute
48 1 Mr. DTTH
49 1 Mr. DTTH
Copy and execute the following command to update the critical components of the system :
50 1 Mr. DTTH
51 1 Mr. DTTH
 yum update
52 1 Mr. DTTH
53 1 Mr. DTTH
!YumUpdate.png!
54 1 Mr. DTTH
 
55 1 Mr. DTTH
After the update completed, we need to restart the system using the following command :
56 1 Mr. DTTH
57 1 Mr. DTTH
 reboot
58 1 Mr. DTTH
59 1 Mr. DTTH
h2. Install the dependencies packages
60 1 Mr. DTTH
61 1 Mr. DTTH
These are the basic software packages for environment settings and utility tools to compile other packages in the next section.
62 1 Mr. DTTH
63 1 Mr. DTTH
Copy the block command and execute in the Putty Windows :
64 1 Mr. DTTH
65 1 Mr. DTTH
This is a long command line, copy all and implementation.
66 1 Mr. DTTH
67 1 Mr. DTTH
 yum -y install nano zip unzip libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA
68 1 Mr. DTTH
69 1 Mr. DTTH
!InstallPackages.png!
70 1 Mr. DTTH
71 1 Mr. DTTH
h2. Install Apache and MySQL
72 1 Mr. DTTH
73 1 Mr. DTTH
Apache is a server application for communicating over the HTTP protocol. Apache runs on operating systems such as Unix, Linux, Microsoft Windows, and other operating systems.
74 1 Mr. DTTH
75 1 Mr. DTTH
Apache play an important role in the development of the internet and the world wide web.
76 1 Mr. DTTH
77 1 Mr. DTTH
MySQL is the database management free open source most popular on the world, MySQL has high speed, stability and ease of use, portability, operating on multiple operating systems offer a large system is very powerful utility functions.
78 1 Mr. DTTH
79 1 Mr. DTTH
With the speed and high security, MySQL is well suited for applications that access databases on the internet.
80 1 Mr. DTTH
81 1 Mr. DTTH
Use the following command to install :
82 1 Mr. DTTH
83 1 Mr. DTTH
 yum -y install httpd mysql mysql-server
84 1 Mr. DTTH
85 1 Mr. DTTH
!InstallApacheMysql.png!
86 1 Mr. DTTH
 
87 1 Mr. DTTH
Allow start services when OS boot :
88 1 Mr. DTTH
89 1 Mr. DTTH
<pre><code class="C">
90 1 Mr. DTTH
chkconfig httpd on
91 1 Mr. DTTH
chkconfig mysqld on
92 1 Mr. DTTH
service httpd start
93 1 Mr. DTTH
service mysqld start
94 1 Mr. DTTH
</code></pre>
95 1 Mr. DTTH
96 1 Mr. DTTH
Set the password for MySQL
97 1 Mr. DTTH
98 1 Mr. DTTH
 /usr/bin/mysql_secure_installation
99 1 Mr. DTTH
100 1 Mr. DTTH
Because we not have a password for the root account so you press Enter to skip.
101 1 Mr. DTTH
102 1 Mr. DTTH
 Enter current password for root (enter for none):
103 1 Mr. DTTH
104 1 Mr. DTTH
Select Yes to set the password for the MySQL root account.
105 1 Mr. DTTH
106 1 Mr. DTTH
 Set root password? [Y/n] y
107 1 Mr. DTTH
108 1 Mr. DTTH
Enter and confirm your password, remove the anonymous user, select Yes
109 1 Mr. DTTH
110 1 Mr. DTTH
 Remove anonymous users? [Y/n] y
111 1 Mr. DTTH
112 1 Mr. DTTH
Allow remote login to MySQL as root account, select No.
113 1 Mr. DTTH
114 1 Mr. DTTH
 Disallow root login remotely? [Y/n] n
115 1 Mr. DTTH
116 1 Mr. DTTH
Delete the test database, select Yes
117 1 Mr. DTTH
118 1 Mr. DTTH
 Remove test database and access to it? [Y/n] y
119 1 Mr. DTTH
120 1 Mr. DTTH
Reload privilege tables, select Yes
121 1 Mr. DTTH
122 1 Mr. DTTH
 Reload privilege tables now? [Y/n] y
123 1 Mr. DTTH
124 1 Mr. DTTH
h2. Turn off SELinux
125 1 Mr. DTTH
126 1 Mr. DTTH
SELinux is a security feature advanced for Linux operating system, when installing the system you need to turn off this feature to get the process done smoothly, after successful you can turn on back if you want.
127 1 Mr. DTTH
128 1 Mr. DTTH
 nano /etc/selinux/config
129 1 Mr. DTTH
130 1 Mr. DTTH
Change the file content :
131 1 Mr. DTTH
132 1 Mr. DTTH
 SELINUX=disabled
133 1 Mr. DTTH
134 1 Mr. DTTH
!EditSELinux.png!
135 1 Mr. DTTH
136 1 Mr. DTTH
Press CTRL + O to save the file and press CTRL + X to exit.
137 1 Mr. DTTH
138 1 Mr. DTTH
h2. Set up the Hostname
139 1 Mr. DTTH
140 1 Mr. DTTH
By default when installing a new OS Centos not set the hostname, so we need to setting with the command :
141 1 Mr. DTTH
142 1 Mr. DTTH
 nano /etc/hosts
143 1 Mr. DTTH
144 1 Mr. DTTH
!SetHostname.png!
145 1 Mr. DTTH
 
146 1 Mr. DTTH
Add your domain name or host name that you set on both the command line, save the file and exit, the server name will be changed when restarting.
147 1 Mr. DTTH
148 1 Mr. DTTH
h2. Configuring the Firewall
149 1 Mr. DTTH
150 1 Mr. DTTH
We do not want to turn off the firewall because it's quite important, so you need to add rules to allow port 80 for HTTP and port 443 for HTTPS.
151 1 Mr. DTTH
152 1 Mr. DTTH
In the Centos OS, you can configuration firewall by editing files iptables and ip6tables.
153 1 Mr. DTTH
154 1 Mr. DTTH
 nano /etc/sysconfig/iptables
155 1 Mr. DTTH
156 1 Mr. DTTH
!ConfigFirewall.png!
157 1 Mr. DTTH
158 1 Mr. DTTH
Press Enter to create a new line after the line of port 22, copy the following two commands and right click on the window to the Paste command.
159 1 Mr. DTTH
160 1 Mr. DTTH
<pre><code class="C">
161 1 Mr. DTTH
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
162 1 Mr. DTTH
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
163 1 Mr. DTTH
</code></pre>
164 1 Mr. DTTH
165 1 Mr. DTTH
Press CTRL + O to save the file and press CTRL + X to exit.
166 1 Mr. DTTH
167 1 Mr. DTTH
The same applies for IP6 firewall :
168 1 Mr. DTTH
169 1 Mr. DTTH
 nano /etc/sysconfig/ip6tables
170 1 Mr. DTTH
171 1 Mr. DTTH
Add these lines to the file.
172 1 Mr. DTTH
173 1 Mr. DTTH
<pre><code class="C">
174 1 Mr. DTTH
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
175 1 Mr. DTTH
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
176 1 Mr. DTTH
</code></pre>
177 1 Mr. DTTH
178 1 Mr. DTTH
After you finish editing both files, run the commands to apply the new rules for firewall.
179 1 Mr. DTTH
180 1 Mr. DTTH
<pre><code class="C">
181 1 Mr. DTTH
/etc/init.d/iptables restart
182 1 Mr. DTTH
/etc/init.d/ip6tables restart
183 1 Mr. DTTH
</code></pre>
184 1 Mr. DTTH
185 1 Mr. DTTH
Allow turn on the firewall when reboot the operating system.
186 1 Mr. DTTH
187 1 Mr. DTTH
<pre><code class="C">
188 1 Mr. DTTH
chkconfig iptables on
189 1 Mr. DTTH
chkconfig ip6tables on
190 1 Mr. DTTH
</code></pre>
191 1 Mr. DTTH
192 1 Mr. DTTH
Finally, we need to restart the system to apply the changes to the SELinux and Hostname.
193 1 Mr. DTTH
194 1 Mr. DTTH
 reboot
195 1 Mr. DTTH
196 1 Mr. DTTH
h2. Install PHP and phpMyAdmin
197 1 Mr. DTTH
198 1 Mr. DTTH
Because we use MySQL database management system, so we need to install phpMyAdmin program management.
199 1 Mr. DTTH
200 1 Mr. DTTH
phpMyAdmin is a free open source tool written by PHP language to manage MySQL database via a web browser.
201 1 Mr. DTTH
202 1 Mr. DTTH
It can create, modify or delete databases, tables, fields or records, perform SQL statements, or managing users and permissions.
203 1 Mr. DTTH
204 1 Mr. DTTH
The command to install PHP and the packages :
205 1 Mr. DTTH
206 1 Mr. DTTH
 yum -y install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap
207 1 Mr. DTTH
208 1 Mr. DTTH
!InstallPHP.png!
209 1 Mr. DTTH
210 1 Mr. DTTH
Restarting the Apache service :
211 1 Mr. DTTH
212 1 Mr. DTTH
 service httpd restart
213 1 Mr. DTTH
214 1 Mr. DTTH
And install phpMyadmin :
215 1 Mr. DTTH
216 1 Mr. DTTH
<pre><code class="C">
217 1 Mr. DTTH
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
218 1 Mr. DTTH
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
219 1 Mr. DTTH
yum -y install phpmyadmin
220 1 Mr. DTTH
</code></pre>
221 1 Mr. DTTH
222 1 Mr. DTTH
!InstallphpMyadmin.png!
223 1 Mr. DTTH
224 1 Mr. DTTH
Editing the virtual host file to allow remote login to the phpMyadmin.
225 1 Mr. DTTH
226 1 Mr. DTTH
 nano /etc/httpd/conf.d/phpmyadmin.conf
227 1 Mr. DTTH
228 1 Mr. DTTH
!EditVirtualHostPHPMyadmin.png!
229 1 Mr. DTTH
 
230 1 Mr. DTTH
Replace text "Allow from 127.0.0.1" to "Allow from all", save the file and exit.
231 1 Mr. DTTH
232 1 Mr. DTTH
Editing the configuration file for the phpMyadmin
233 1 Mr. DTTH
234 1 Mr. DTTH
 nano /usr/share/phpmyadmin/config.inc.php
235 1 Mr. DTTH
236 1 Mr. DTTH
!EditConfigPHPMyadmin.png!
237 1 Mr. DTTH
 
238 1 Mr. DTTH
Replace text :
239 1 Mr. DTTH
240 1 Mr. DTTH
 $cfg['Servers'][$i]['auth_type'] = 'cookie';
241 1 Mr. DTTH
242 1 Mr. DTTH
To :
243 1 Mr. DTTH
244 1 Mr. DTTH
 $cfg['Servers'][$i]['auth_type'] = 'http';
245 1 Mr. DTTH
246 1 Mr. DTTH
Save the file and exit, restarting the Apache service :
247 1 Mr. DTTH
248 1 Mr. DTTH
 service httpd restart
249 1 Mr. DTTH
250 1 Mr. DTTH
After successfully installed phpMyadmin, you can check at the address :
251 1 Mr. DTTH
252 1 Mr. DTTH
http://your-domain/phpmyadmin
253 1 Mr. DTTH
254 1 Mr. DTTH
Login with account :  root / your_password
255 1 Mr. DTTH
256 1 Mr. DTTH
With Password has been set at step install MySQL database in the above.
257 1 Mr. DTTH
258 1 Mr. DTTH
!CompleteInstallphpMyadmin.png!
259 1 Mr. DTTH
260 1 Mr. DTTH
Note: If you install the Redmine system on the PC or in a virtual machine which not on the dedicated server, we need to switch the application phpMyadmin to run on port 8080 because port 80 will be used for Redmine in the next steps.
261 1 Mr. DTTH
262 1 Mr. DTTH
We need add a port 8080 to the firewall and change the VirtualHost for phpMyadmin.
263 1 Mr. DTTH
264 1 Mr. DTTH
 nano /etc/sysconfig/iptables
265 1 Mr. DTTH
266 1 Mr. DTTH
!Iptables.png!
267 1 Mr. DTTH
 
268 1 Mr. DTTH
Add the command line :
269 1 Mr. DTTH
270 1 Mr. DTTH
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
271 1 Mr. DTTH
272 1 Mr. DTTH
The same applies for IP6 firewall :
273 1 Mr. DTTH
274 1 Mr. DTTH
 nano /etc/sysconfig/ip6tables
275 1 Mr. DTTH
276 1 Mr. DTTH
Add the command line :
277 1 Mr. DTTH
278 1 Mr. DTTH
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
279 1 Mr. DTTH
280 1 Mr. DTTH
Restarting firewall service to allow the new port.
281 1 Mr. DTTH
282 1 Mr. DTTH
<pre><code class="C">
283 1 Mr. DTTH
/etc/init.d/iptables restart
284 1 Mr. DTTH
/etc/init.d/ip6tables restart
285 1 Mr. DTTH
</code></pre>
286 1 Mr. DTTH
287 1 Mr. DTTH
Editing the VirtualHost file to run phpMyadmin on the port 8080
288 1 Mr. DTTH
289 1 Mr. DTTH
 nano /etc/httpd/conf.d/phpmyadmin.conf
290 1 Mr. DTTH
291 1 Mr. DTTH
!PhpMyadmin8080.png!
292 1 Mr. DTTH
 
293 1 Mr. DTTH
Change the file content :
294 1 Mr. DTTH
295 1 Mr. DTTH
<pre><code class="C">
296 1 Mr. DTTH
<VirtualHost *:8080>
297 1 Mr. DTTH
    DocumentRoot /usr/share/phpmyadmin/
298 1 Mr. DTTH
    ServerName your_domain.com
299 1 Mr. DTTH
</VirtualHost>
300 1 Mr. DTTH
</code></pre>
301 1 Mr. DTTH
302 1 Mr. DTTH
Next, add the command to allows listening on the port 8080 in the file "httpd.conf"
303 1 Mr. DTTH
304 1 Mr. DTTH
 nano /etc/httpd/conf/httpd.conf
305 1 Mr. DTTH
306 1 Mr. DTTH
!httpd.png!
307 1 Mr. DTTH
 
308 1 Mr. DTTH
Add the command line :
309 1 Mr. DTTH
310 1 Mr. DTTH
 Listen 8080
311 1 Mr. DTTH
312 1 Mr. DTTH
Save the file and exit, restarting the Apache service :
313 1 Mr. DTTH
314 1 Mr. DTTH
 service httpd restart
315 1 Mr. DTTH
316 1 Mr. DTTH
!RunPHPMyadmin.png!
317 1 Mr. DTTH
 
318 1 Mr. DTTH
Now, phpMyadmin will run on the port 8080 at the address :
319 1 Mr. DTTH
320 1 Mr. DTTH
http://your-domain:8080
321 1 Mr. DTTH
322 1 Mr. DTTH
h2. Install Ruby
323 1 Mr. DTTH
324 1 Mr. DTTH
Ruby is a object-oriented programming language, capable of reflection. Syntax inherited from Ada and Perl with object-oriented features of Smalltalk, and also share some features with Python, Lisp, Dylan and CLU, Ruby is a single phase interpreter.
325 1 Mr. DTTH
326 1 Mr. DTTH
Ruby provides programming patterns, including functional programming, object-oriented, imperative, reflective, it uses dynamic variable and automatic memory management.
327 1 Mr. DTTH
328 1 Mr. DTTH
Install Ruby interpreter with version management program RVM.
329 1 Mr. DTTH
330 1 Mr. DTTH
 \curl -L https://get.rvm.io | bash
331 1 Mr. DTTH
332 1 Mr. DTTH
After successful, we will launch RVM
333 1 Mr. DTTH
334 1 Mr. DTTH
 source /etc/profile.d/rvm.sh
335 1 Mr. DTTH
336 1 Mr. DTTH
The following command will list the versions of Ruby to install :
337 1 Mr. DTTH
338 1 Mr. DTTH
 rvm list known
339 1 Mr. DTTH
340 1 Mr. DTTH
!ListAllVersionRuby.png!
341 1 Mr. DTTH
 
342 1 Mr. DTTH
We choose the stable version [ruby-] 1.9.3 [-p545], and execute the following command :
343 1 Mr. DTTH
344 1 Mr. DTTH
 rvm install 1.9.3
345 1 Mr. DTTH
346 1 Mr. DTTH
!InstallRuby.png!
347 1 Mr. DTTH
 
348 1 Mr. DTTH
The installation process is pretty long time, but you do not need any intervention, after successful, you check with the following command :
349 1 Mr. DTTH
350 1 Mr. DTTH
 ruby -v
351 1 Mr. DTTH
352 1 Mr. DTTH
h2. Install Rubygems
353 1 Mr. DTTH
354 1 Mr. DTTH
Rubygems is a Ruby's packages management program, very popular in applications written by Ruby language and the Ruby On Rails framework.
355 1 Mr. DTTH
356 1 Mr. DTTH
 yum -y install rubygems
357 1 Mr. DTTH
358 1 Mr. DTTH
!InstallRubyGem.png!
359 1 Mr. DTTH
360 1 Mr. DTTH
h2. Install Passenger
361 1 Mr. DTTH
362 1 Mr. DTTH
The full name of the Passenger is Phusion Passenger, known as mod_rails or mod_rack, it is a web application intergrate with Apache and it can operate as a standalone web server support for the Ruby On Rails applications.
363 1 Mr. DTTH
364 1 Mr. DTTH
Execute the following commands :
365 1 Mr. DTTH
366 1 Mr. DTTH
<pre><code class="C">
367 1 Mr. DTTH
gem install passenger
368 1 Mr. DTTH
passenger-install-apache2-module
369 1 Mr. DTTH
</code></pre>
370 1 Mr. DTTH
371 1 Mr. DTTH
!InstallPassenger.png!
372 1 Mr. DTTH
373 1 Mr. DTTH
After completed, we copy a notification block in the window to create the configuration file in the next steps (select block notification and press C to copy).
374 1 Mr. DTTH
375 1 Mr. DTTH
<pre><code class="C">
376 1 Mr. DTTH
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p545/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
377 1 Mr. DTTH
<IfModule mod_passenger.c>
378 1 Mr. DTTH
   PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p545/gems/passenger-4.0.37
379 1 Mr. DTTH
   PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p545/wrappers/ruby
380 1 Mr. DTTH
</IfModule>
381 1 Mr. DTTH
</code></pre>
382 1 Mr. DTTH
383 1 Mr. DTTH
Create a new virtual host file for Passenger :
384 1 Mr. DTTH
385 1 Mr. DTTH
 nano /etc/httpd/conf.d/passenger.conf
386 1 Mr. DTTH
387 1 Mr. DTTH
Paste the command blocks into the empty file and save it, then restart the Apache service.
388 1 Mr. DTTH
389 1 Mr. DTTH
 service httpd restart
390 1 Mr. DTTH
391 1 Mr. DTTH
h2. Create Database for Redmine
392 1 Mr. DTTH
393 1 Mr. DTTH
Use MySQLAdmin to create an empty database for Redmine, saved password to fill in the configuration file in the next steps.
394 1 Mr. DTTH
395 1 Mr. DTTH
<pre><code class="C">
396 1 Mr. DTTH
mysql --user=root --password=root_password_mysql
397 1 Mr. DTTH
create database redmine_db character set utf8;
398 1 Mr. DTTH
create user 'redmine_admin'@'localhost' identified by 'your_new_password';
399 1 Mr. DTTH
grant all privileges on redmine_db.* to 'redmine_admin'@'localhost';
400 1 Mr. DTTH
quit;
401 1 Mr. DTTH
</code></pre>
402 1 Mr. DTTH
403 1 Mr. DTTH
!RedmineDB.png!
404 1 Mr. DTTH
405 1 Mr. DTTH
h2. Install Redmine
406 1 Mr. DTTH
407 1 Mr. DTTH
Redmine is a main program of the project management system, we will download and install the program from the website of Redmine.
408 1 Mr. DTTH
409 1 Mr. DTTH
Download Redmine version 2.5.x to directory "/var/www" on the Centos OS.
410 1 Mr. DTTH
411 1 Mr. DTTH
<pre><code class="C">
412 1 Mr. DTTH
cd /var/www
413 1 Mr. DTTH
wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz
414 1 Mr. DTTH
</code></pre>
415 1 Mr. DTTH
416 1 Mr. DTTH
Extract the folder and rename directory
417 1 Mr. DTTH
418 1 Mr. DTTH
<pre><code class="C">
419 1 Mr. DTTH
tar xvfz redmine-2.5.0.tar.gz
420 1 Mr. DTTH
mv redmine-2.5.0 redmine
421 1 Mr. DTTH
rm -rf redmine-2.5.0.tar.gz
422 1 Mr. DTTH
</code></pre>
423 1 Mr. DTTH
424 1 Mr. DTTH
Configuring the Database
425 1 Mr. DTTH
426 1 Mr. DTTH
The next, we need to configure the database was created from the above steps.
427 1 Mr. DTTH
428 1 Mr. DTTH
<pre><code class="C">
429 1 Mr. DTTH
cd /var/www/redmine/config
430 1 Mr. DTTH
cp database.yml.example database.yml
431 1 Mr. DTTH
nano database.yml
432 1 Mr. DTTH
</code></pre>
433 1 Mr. DTTH
434 1 Mr. DTTH
!ConfigDBRedmine.png!
435 1 Mr. DTTH
436 1 Mr. DTTH
Enter name for database, enter username and password of the database. Press CTRL + O to save the file and CTRL + X to exit.
437 1 Mr. DTTH
438 1 Mr. DTTH
h2. Setting up Rails
439 1 Mr. DTTH
440 1 Mr. DTTH
Install the package library support for Rails using the Bundle.
441 1 Mr. DTTH
442 1 Mr. DTTH
<pre><code class="C">
443 1 Mr. DTTH
cd /var/www/redmine
444 1 Mr. DTTH
gem install bundler
445 1 Mr. DTTH
bundle install
446 1 Mr. DTTH
rake generate_secret_token
447 1 Mr. DTTH
</code></pre>
448 1 Mr. DTTH
449 1 Mr. DTTH
!BundleInstall.png!
450 1 Mr. DTTH
451 1 Mr. DTTH
The next, we create the database table for the Redmine application.
452 1 Mr. DTTH
453 1 Mr. DTTH
<pre><code class="C">
454 1 Mr. DTTH
RAILS_ENV=production rake db:migrate
455 1 Mr. DTTH
RAILS_ENV=production rake redmine:load_default_data
456 1 Mr. DTTH
</code></pre>
457 1 Mr. DTTH
458 1 Mr. DTTH
h2. Activate FCGI
459 1 Mr. DTTH
460 1 Mr. DTTH
<pre><code class="C">
461 1 Mr. DTTH
cd /var/www/redmine/public
462 1 Mr. DTTH
mkdir plugin_assets
463 1 Mr. DTTH
cp dispatch.fcgi.example dispatch.fcgi
464 1 Mr. DTTH
cp htaccess.fcgi.example .htaccess
465 1 Mr. DTTH
</code></pre>
466 1 Mr. DTTH
467 1 Mr. DTTH
h2. Setting up Apache and FastCGI
468 1 Mr. DTTH
469 1 Mr. DTTH
<pre><code class="C">
470 1 Mr. DTTH
cd /var/www/
471 1 Mr. DTTH
rpm --import https://fedoraproject.org/static/0608B895.txt
472 1 Mr. DTTH
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
473 1 Mr. DTTH
rpm -ivh epel-release-6-8.noarch.rpm
474 1 Mr. DTTH
yum -y install mod_fcgid
475 1 Mr. DTTH
rm -rf epel-release-6-8.noarch.rpm
476 1 Mr. DTTH
</code></pre>
477 1 Mr. DTTH
478 1 Mr. DTTH
h2. Creating Files Directory
479 1 Mr. DTTH
480 1 Mr. DTTH
This directory contains data files generated during the operation of Redmine as document or image file, we create a new directory in the "/opt".
481 1 Mr. DTTH
482 1 Mr. DTTH
<pre><code class="C">
483 1 Mr. DTTH
mkdir -p /opt/redmine/files
484 1 Mr. DTTH
chown -R apache:apache /opt/redmine
485 1 Mr. DTTH
cd /var/www/redmine/config
486 1 Mr. DTTH
cp configuration.yml.example configuration.yml
487 1 Mr. DTTH
nano configuration.yml
488 1 Mr. DTTH
</code></pre>
489 1 Mr. DTTH
490 1 Mr. DTTH
!AttachFilesPath.png!
491 1 Mr. DTTH
 
492 1 Mr. DTTH
Enter the directory path containing the data files you just created in the previous step into the line "attachments_storage_path".
493 1 Mr. DTTH
494 1 Mr. DTTH
Note: You must add a space at the begin of the path "/opt/redmine/files" after character ":"
495 1 Mr. DTTH
496 1 Mr. DTTH
h2. Configuring Email
497 1 Mr. DTTH
498 1 Mr. DTTH
Another very important function of Redmine is using email to notify members when the contents of each project changes, Redmine can use many different methods to send email that is Sendmail, SMTP, GMail ...
499 1 Mr. DTTH
500 1 Mr. DTTH
To configure the email we will edit the configuration file.
501 1 Mr. DTTH
502 1 Mr. DTTH
 nano /var/www/redmine/config/configuration.yml
503 1 Mr. DTTH
504 1 Mr. DTTH
The simplest is you use features of the default SendMail in the Centos OS by settings :
505 1 Mr. DTTH
506 1 Mr. DTTH
<pre><code class="C">
507 1 Mr. DTTH
  email_delivery:
508 1 Mr. DTTH
   delivery_method: :sendmail
509 1 Mr. DTTH
</code></pre>
510 1 Mr. DTTH
511 1 Mr. DTTH
Note : Do not use the Tab key to indent when editing the configuration file, you need to use the space bar on the keyboard.
512 1 Mr. DTTH
513 1 Mr. DTTH
If you use GMail's SMTP, you need to register an email account with the login methods used password normal and disable two-step authentication by smart phone.
514 1 Mr. DTTH
515 1 Mr. DTTH
Enter your Gmail account as below :
516 1 Mr. DTTH
517 1 Mr. DTTH
<pre><code class="C">
518 1 Mr. DTTH
  email_delivery:
519 1 Mr. DTTH
   delivery_method: :smtp
520 1 Mr. DTTH
   smtp_settings:
521 1 Mr. DTTH
        enable_starttls_auto: true
522 1 Mr. DTTH
        address: "smtp.gmail.com"
523 1 Mr. DTTH
        port: 587
524 1 Mr. DTTH
        domain: "smtp.gmail.com"
525 1 Mr. DTTH
        authentication: :plain
526 1 Mr. DTTH
        user_name: "your_email@gmail.com"
527 1 Mr. DTTH
        password: "your_password"
528 1 Mr. DTTH
</code></pre>
529 1 Mr. DTTH
530 1 Mr. DTTH
Save the file configuration and exit.
531 1 Mr. DTTH
532 1 Mr. DTTH
h2. Create Virtual Host for Redmine
533 1 Mr. DTTH
534 1 Mr. DTTH
Create an Apache configuration file for the Redmine application at the port 80.
535 1 Mr. DTTH
536 1 Mr. DTTH
 nano /etc/httpd/conf.d/redmine.conf
537 1 Mr. DTTH
538 1 Mr. DTTH
Copy the text below and paste into the editor window, note the information to change your domain name.
539 1 Mr. DTTH
540 1 Mr. DTTH
<pre><code class="C">
541 1 Mr. DTTH
<VirtualHost *:80>
542 1 Mr. DTTH
        ServerName your_domain
543 1 Mr. DTTH
        ServerAdmin your_domain@domain.com
544 1 Mr. DTTH
        DocumentRoot /var/www/redmine/public/
545 1 Mr. DTTH
        ErrorLog logs/redmine_error_log
546 1 Mr. DTTH
        <Directory "/var/www/redmine/public/">
547 1 Mr. DTTH
                Options Indexes ExecCGI FollowSymLinks
548 1 Mr. DTTH
                Order allow,deny
549 1 Mr. DTTH
                Allow from all
550 1 Mr. DTTH
                AllowOverride all
551 1 Mr. DTTH
        </Directory>
552 1 Mr. DTTH
</VirtualHost>
553 1 Mr. DTTH
</code></pre>
554 1 Mr. DTTH
555 1 Mr. DTTH
Save the file configuration and exit.
556 1 Mr. DTTH
557 1 Mr. DTTH
h2. Running Redmine
558 1 Mr. DTTH
559 1 Mr. DTTH
Before execute Redmine in the first time, we must permission for the directory installed Redmine and restart Apache service.
560 1 Mr. DTTH
561 1 Mr. DTTH
<pre><code class="C">
562 1 Mr. DTTH
cd /var/www
563 1 Mr. DTTH
chown -R apache:apache redmine
564 1 Mr. DTTH
chmod -R 755 redmine
565 1 Mr. DTTH
service httpd restart
566 1 Mr. DTTH
</code></pre>
567 1 Mr. DTTH
568 1 Mr. DTTH
!Redmine.png!
569 1 Mr. DTTH
570 1 Mr. DTTH
Redmine will run at the following address URL :
571 1 Mr. DTTH
572 1 Mr. DTTH
http://your-domain
573 1 Mr. DTTH
574 1 Mr. DTTH
Login to system with an administrator account : admin / admin
575 1 Mr. DTTH
576 1 Mr. DTTH
You can change your password after successful login.
577 1 Mr. DTTH
578 1 Mr. DTTH
We can see Redmine has running but very primitive, in the next steps we will install the support plugins and customized Redmine to use professional.
579 1 Mr. DTTH
580 1 Mr. DTTH
h2. Install Subversion
581 1 Mr. DTTH
582 1 Mr. DTTH
Subversion, also known as SVN, it is a version management system is very popular and easy to use, most programmers can use it competently.
583 1 Mr. DTTH
584 1 Mr. DTTH
We need to create a folder to store data for Redmine, the following command creates a directory and permissions for the Apache service.
585 1 Mr. DTTH
586 1 Mr. DTTH
<pre><code class="C">
587 1 Mr. DTTH
mkdir -p /opt/repositories/svn
588 1 Mr. DTTH
chown -R apache:apache /opt/repositories/
589 1 Mr. DTTH
chmod 0755 /opt/repositories
590 1 Mr. DTTH
</code></pre>
591 1 Mr. DTTH
592 1 Mr. DTTH
The following command install Subversion and the packages :
593 1 Mr. DTTH
594 1 Mr. DTTH
 yum install mod_dav_svn subversion subversion-ruby
595 1 Mr. DTTH
596 1 Mr. DTTH
!InstallSVN.png!
597 1 Mr. DTTH
 
598 1 Mr. DTTH
The next, we will create a directory and copy the file called "Redmine.pm", it responsible for interface data repository with Redmine and it is written by Perl language programming.
599 1 Mr. DTTH
600 1 Mr. DTTH
<pre><code class="C">
601 1 Mr. DTTH
mkdir /usr/lib64/perl5/vendor_perl/Apache
602 1 Mr. DTTH
ln -s /var/www/redmine/extra/svn/Redmine.pm /usr/lib64/perl5/vendor_perl/Apache/Redmine.pm
603 1 Mr. DTTH
</code></pre>
604 1 Mr. DTTH
605 1 Mr. DTTH
Note : If you are using 32 bit Centos, change the path "/usr/lib64" to "/usr/lib"
606 1 Mr. DTTH
607 1 Mr. DTTH
After installation is complete, from the Redmine application, go to the page *Administration> Settings> Repositories* to check the results.
608 1 Mr. DTTH
 
609 1 Mr. DTTH
To support the authentication and access to data repository for each member, we need to create a virtual host for the Apache service can access Redmine database.
610 1 Mr. DTTH
611 1 Mr. DTTH
 nano /etc/httpd/conf.d/subversion.conf
612 1 Mr. DTTH
613 1 Mr. DTTH
Add the following lines to the end and still retain the old contents of the file :
614 1 Mr. DTTH
615 1 Mr. DTTH
<pre><code class="C">
616 1 Mr. DTTH
PerlLoadModule Apache::Redmine
617 1 Mr. DTTH
<Location /svn>
618 1 Mr. DTTH
        DAV svn
619 1 Mr. DTTH
        SVNParentPath "/opt/repositories/svn" 
620 1 Mr. DTTH
        SVNListParentPath on
621 1 Mr. DTTH
        Order deny,allow
622 1 Mr. DTTH
        Deny from all
623 1 Mr. DTTH
        Satisfy any
624 1 Mr. DTTH
        LimitXMLRequestBody 0
625 1 Mr. DTTH
        SVNPathAuthz off
626 1 Mr. DTTH
        PerlAccessHandler Apache::Authn::Redmine::access_handler
627 1 Mr. DTTH
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
628 1 Mr. DTTH
        AuthType Basic
629 1 Mr. DTTH
        AuthName "Subversion Repository" 
630 1 Mr. DTTH
        Require valid-user
631 1 Mr. DTTH
        RedmineDSN "DBI:mysql:database=redmine_db;host=localhost:3306" 
632 1 Mr. DTTH
        RedmineDbUser "redmine_admin" 
633 1 Mr. DTTH
        RedmineDbPass "your_password_database_redmine" 
634 1 Mr. DTTH
</Location> 
635 1 Mr. DTTH
</code></pre>
636 1 Mr. DTTH
637 1 Mr. DTTH
Note : You need to change the password in the "RedmineDbPass" to correct the database password of Redmine.
638 1 Mr. DTTH
639 1 Mr. DTTH
At this point, we have finished the basic settings for Redmine.
640 1 Mr. DTTH
641 1 Mr. DTTH
Thank you!