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

Mr. DTTH, 2015-01-06 03:52

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