Monday, January 25, 2010

Setting-up the development infrastructure 2 - Subversion

Installing Subversion is straightforward. With Fedora-Core 11 (FC11), we could install the necessary packages via yum:
$ yum install subversion mod_dav_svn

The package mod_dav_svn is needed for accessing Subversion repositories via Apache.

After the installation, we decided to have the Subversion repositories under /home/svn. We created one repository for our project:
$ cd /home/svn
$ svnadmin create our-project


Making Subversion repositories accessible via Apache


To make the repository accessible via Apache, we first had to configure Apache accordingly. The repository, and all future ones respectively, should be accessible via http://our-domain.org/svn/*. So, we had to configure a location in the default virtual host (/etc/http/conf.d/vhost.conf):
<VirtualHost *:80>
...
<Location /svn>
DAV svn
SVNParentPath /home/svn
AuthType Basic
AuthName "Subversion Repositories"
AuthUserFile /etc/subversion/svn-users
Require valid-user
</Location>
</VirtualHost>


The user passwords in the file /etc/subversion/svn-users are created with htpasswd.

To let Apache access the Subversion repository, we had to change the permissions of the corresponding directory:
$ cd /home/svn
$ chown -R apache:apache our-project

Since we did these steps, we can browse the repository via http://our-domain.org/svn/our-project.

Sunday, January 17, 2010

Setting-up the development infrastructure 1 - Redmine

The sooner we write down all decisions the better. Thus, the Wiki is the most important tool and has to be installed first.

Setting up Redmine is straightforward. We used Redmine's own installation guide. On Fedora-Core 11 (FC11), we had to install the following packages in advance:
$ yum install mysql mysql-server ruby rubygem-rake

We also installed the ruby-C-mysql-connector. Since the connector has to be built from scratch, we had to get additional FC11 packages:
$ yum install ruby-devel mysql-devel gcc

Installing these packages is necessary; without we got the errors:
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install mysql
can't find header files for ruby.

and
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install mysql
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***

Now, the ruby-C-mysql-connector can be installed via gem
$ gem install mysql


Making Redmine accessible via Apache


Since Redmine is written in Ruby on Rails, we use the Apache passenger module to pass client-request through Apache to Redmine. The passenger module is compiled from scratch, therefore, we installed the httpd-devel and gcc-c++ packages via yum and used gem to install the module:
$ yum install httpd-devel gcc-c++
$ gem install passenger
$ passenger-install-apache2-module

On FC11 and older Fedora-Core installations, the httpd configuration resides under /etc/httpd. The main config file is /etc/httpd/conf/httpd.conf. Since user configurations should go into the directory /etc/httpd/conf.d, we enabled virtual hosting by making the file /etc/httpd/conf.d/vhosts.conf:
NameVirtualHost *:80

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby
LoadModule dav_svn_module modules/mod_dav_svn.so

<VirtualHost *:80>
ServerName our-domain.org
DocumentRoot /var/www/redmine-0.8.5/public
</VirtualHost>

By entering the address http://our-domain.org in a browser, we saw the Redmine start page.