HOWTO Install Subversion and Redmine on CentOS5 + RHEL5

Version 2 (Rob Freeman, 01/21/2009 05:26 PM)

1 1
h1. HOWTO: Install Subversion and Redmine on CentOS5 (& RHEL5)
2 1
3 1
NOTES
4 1
* This HOWTO is written for CentOS 5.2
5 1
* Replace [FQDN] with either your IP address or the hostname (or FQDN) which you’ll be using to access the interface.
6 1
* Replace [user] with the username under whom's home directory the Subversion repository database will be located. e.g. /home/[user]/svn-repos
7 1
8 1
* This HOWTO will be using the following variables:
9 1
>* You will be running apache as the user ‘apache’
10 1
>* The subversion repository root folder will be under /home/[user]/subversion/
11 1
>* The vhost's folder locationg will be /var/www/svn
12 1
>* The subversion repository to be created will be called ‘example-repo’
13 1
14 1
Install and set up Subversion
15 1
<pre>
16 1
yum install mod_dav_svn subversion
17 1
</pre>
18 1
19 1
Add the group [user] to the user apache and make the subversion base URL readable and writable...
20 1
<pre>
21 1
usermod -aG [user] apache
22 1
chmod g+x /home/[user]
23 1
mkdir /home/[user]/subversion
24 1
chmod g+rwx /home/[user]/subversion
25 1
</pre>
26 1
27 1
Make the web directory:
28 1
<pre>
29 1
mkdir /var/www/svn
30 1
chown apache.apache /var/www/svn
31 1
</pre>
32 1
33 1
Put the following into /etc/httpd/conf.d/svn.conf (this is for a sub-repo called 'example-repo')
34 1
<pre>
35 1
NameVirtualHost *:80
36 1
<VirtualHost *:80>
37 1
        DocumentRoot "/var/www/svn"
38 1
        ServerName [FQDN]
39 1
        <Location /example-repo>
40 1
                DAV svn
41 1
                SVNPath /home/[user]/subversion/example-repo
42 1
                AuthType Basic
43 1
                AuthName "Subversion repo"
44 1
                AuthUserFile /var/www/passwd
45 1
                Require valid-user
46 1
        </Location>
47 1
48 1
        <Directory "/var/www/svn">
49 1
        allow from all
50 1
        Options +Indexes
51 1
        </Directory>
52 1
</VirtualHost>
53 1
</pre>
54 1
55 1
Add an HTTP auth user...
56 1
<pre>
57 1
htpasswd -cm /var/www/passwd [user]
58 1
</pre>
59 1
Create a proper SVN repository 
60 1
<pre>
61 1
cd /home/[user]/subversion
62 1
su [user] -c "svnadmin create example-repo"
63 1
</pre>
64 1
Import any SVN repos by doing:
65 1
<pre>
66 1
su [user] -c "svnadmin load example-repo < /path/to/repo/dump/file"
67 1
</pre>
68 1
69 1
Make sure the permissions are correct
70 1
<pre>
71 1
chmod g+rwx /home/[user]/subversion
72 1
chown -R [user].[user] /home/[user]
73 1
</pre>
74 1
75 2 Rob Freeman
*+Now on to Redmine itself+*
76 2 Rob Freeman
77 2 Rob Freeman
*NOTE: Redmine installation requires the EPEL yum repository.
78 1
<pre>
79 1
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'
80 1
</pre>
81 1
82 1
Let's get rails up and running first... [NOTE: not on an SElinux environment cba with that]
83 1
<pre>
84 1
yum install httpd httpd-devel apr make gcc-c++ mysql-server mysql ruby ruby-devel ruby-docs ruby-ri \
85 1
ruby-libs ruby-mode ruby-tcltk ruby-irb ruby-rdoc fcgi fcgi-devel mod_fcgid rubygems subversion-ruby
86 1
</pre>
87 1
88 1
Now we'll install passenger (aka mod_rails)
89 1
<pre>
90 1
gem install passenger
91 1
passenger-install-apache2-module
92 1
</pre>
93 1
94 1
Create and insert this text into /etc/httpd/conf.d/rails.conf (or alternatively edit the existing svn.conf created when we set up subversion)
95 1
96 1
<pre>
97 1
   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
98 1
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6
99 1
   PassengerRuby /usr/bin/ruby
100 1
101 1
   
102 1
NameVirtualHost *:80
103 1
104 1
   <VirtualHost *:80>
105 1
     ServerName 192.168.10.17
106 1
     DocumentRoot /var/www/rails/redmine/public
107 1
   </VirtualHost>
108 1
</pre>
109 1
 
110 1
Get Redmine 0.8 from http://www.redmine.org/wiki/redmine/Download
111 1
<pre>
112 1
cd /usr/src
113 1
svn co http://redmine.rubyforge.org/svn/branches/0.8-stable redmine-0.8
114 1
mkdir /var/www/rails/
115 1
cd /var/www/rails/
116 1
cp -r /usr/src/redmine-0.8/ redmine/
117 1
chown -R apache.apache redmine
118 1
cd redmine
119 1
</pre>
120 1
121 1
Create a clean backup of source files
122 1
<pre>
123 1
tar czf Redmine0.8-clean.tar.gz .
124 1
</pre>
125 1
126 1
Initialise mySQL:
127 1
<pre>
128 1
chkconfig mysqld on
129 1
service mysqld start
130 1
</pre>
131 1
132 1
To secure mysql:
133 1
<pre>
134 1
mysql_secure_installation
135 1
</pre>
136 1
137 1
Create a mysql database for redmine...
138 1
<pre>
139 1
mysql -u<username> -p
140 1
</pre>
141 1
At the prompt enter:
142 1
<pre>
143 1
create database redmine character set utf8;
144 1
</pre>
145 1
Quit with:
146 1
<pre>
147 1
quit
148 1
</pre>
149 1
150 1
<pre>
151 1
cd /var/www/rails/redmine
152 1
cp config/database.yml.example config/database.yml
153 1
</pre>
154 1
Enter the appropriate settings for the [production] section ensuring that