Login Form
Who's Online
We have 12 guests online
BBC News Feed
Proudly Pinoy

Proudly Pinoy

What's This Logo?

Mabuhay! This "Proudly Pinoy" logo expresses pride in being Filipino. It is available for all Filipino designed or owned websites. If you are a Filipino or have a Filipino site, please support this project and express your pride of being Pinoy, by posting this logo on your Pinoy site or blog!

Ako Mismo

Ako Mismo

"Ako Mismo kikilos para sa bayan ko."

Simulan mo ang pagkilos tungo sa muling pagbangon ng Pilipinas.

Maliit man o malaki, ikaw mismo ang magsasabi kung ano ang gagawin mo.

Ubuntu 10.04 LTS
Fedora 14 Laughlin

My QR Code. Scan it!

QR Code

PostHeaderIcon Installing Redmine and Subversion on Ubuntu 10.04

User Rating: / 0
PoorBest 

This how-to is designed to help you install Redmine and Subversion on Ubuntu 10.04. It may work on other version of Ubuntu, and for that matter Linux but I haven’t tested or tried it out.

This guide aims to:

  • Install Subversion with a basic setup
  • Install and setup Ruby on Rail to use Apache via Passenger
  • Install and setup Redmine in a basic configuration

This guide does not:

  • Consider advanced features of Subversion, Redmine, Passenger or Ruby on Rails
  • Look into using other server methods, e.g. mongrel and thin

This is not to say I cannot help you with more advanced configurations, or won’t post about it in the future, I just wanted this guide to help you get up and running with Redmine and subversion as quickly as possible. While this may seem simple, it can be more difficult than first thought, due to Ubuntu’s quirks.

 

Prerequisites

There are a couple of things that need to be installed before you can begin this guide, effectively you need a LAMP cofiguration, of which this series of blog postsdescribes how to install and configure. Now that the server is all setup, lets start by installing subversion

Subversion Installation and Configuration

The main reason for installing Subversion, or SVN for short, first is mainly because it is needed to check out some components later. So lets get stuck in and install SVN.

sudo apt-get install subversion libapache2-svn

The next thing to do is configure the user access for subversion this is done by executing

sudo htpasswd -c /etc/subversion/passwd <username>

Where <username> is a new user. All subsequent users are created by doing the following

sudo htpasswd /etc/subversion/passwd <username>

It is important to note if you have the ‘-c’ command it WILL overwrite the existing user file.

Now you need to decide where you want to put your repositories. I suggest you put them all under one root path, for example /home/svn. For each repository you want create a new folder in the svn root folder and then run the following command to turn it into a repository

svnadmin create /home/svn/yourproject

One thing to note is that we are going to use apache to serve the repositories so we need to make the svn root folder and all subsequent child files and folders accessable by apache. This is typically done by using the following command

sudo chown -R www-data:www-data /home/svn/

The final part to getting your repositories to be accessed from a web address, like www.toyertech.org/svn/evec, is to add the following code to your sites apache config file nomally located in /etc/apache2/sites-available

<Location /svn>
Require valid-user
AuthUserFile /etc/subversion/passwd
AuthName "Your repository name"
AuthType Basic
SVNPath /home/svn
DAV svn
</Location>
The last thing to do is restart apache after saving the file

sudo /etc/init.d/apache2 restart

A couple of caveats. Firstly this only allows you to view and upload to the repository if you have a username and password, and secondly all password details are sent via plain text not via ssl. Configuring subversion to allow gest to view, or upload to, a repository and allowing only ssl access are outside the scope of this document. Check out the Apache and Subversion website for more advance configurations.

 

Redmine Installation and Configuration

The first thing to note is that the current version of Redmine is 1.0.0RC, although a bugfix version, 1.0.1 is a couple of weeks away. This is important as it requires some specific versions of some applications, which might change in future releases, although I will try to keep this up-to-date.

The second thing to note is that Redmine runs on Ruby on Rails rather than things like php. So we will need to install and setup Ruby on Rails first.

Ruby on Rails Installation

The first thing to do is install ruby, and it’s here that a big quirk of Ubuntu crops up. If you were to install the standard ruby package several key parts for running Redmine are left out so instead the following is executed, to install all required components.

sudo apt-get install ruby-full build-essential

If you want to you can get the installation version by running

ruby –v

You should get something like

ruby 1.8.7p5000 (2009-02-22) [i686-linux]

Importantly if your version of ruby is NOT 1.8.6 or 1.8.7 Redmine will fail to work.

Ruby Gems

In order to install a lot of the required components for Redmine, an install called RubyGems will be installed. Unfortunately the current version of RubyGems in Ubuntu seems not to work properly instead download the latest version from the RubyGems Rubyforge site. For me the latest version is 1.3.7. So lets download RubyGems and extract the files.

wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz

tar xzvf rubygems-1.3.7.tgz

The next thing to do is run the setup file and make sure we can use RubyGems using the gem prefix instead of the gem1.8 prefix. This is accomplished by creating a symbolic link.

sudo ruby rubygems-1.3.7/setup.rb

sudo ln –s /usr/bin/gem1.8 /usr/bin/gem

Finally lets just do a bit of housekeeping

rm rubygems-1.3.7.tgz

rm -r rubygems-1.3.7

Rails

Now we are ready to install Rails, and a couple of other things required for Redmine to work. It is important to add the version number after each application as these are required version for Redmine and current versions are not compatible with Redmine.

sudo gem install rails -v=2.3.5

sudo gem install rack -v=1.0.1

sudo gem install rake -v=0.8.3

Be patient when installing. It may take some time and seem to have crashed, it hasn’t. A way to speed up the install is by adding the “–no-rdoc” command. The documentation is normally the longest part of the install.

MySQL Optimisation

A quick tip that can help performance of a Ruby on Rails application that accesses MySQL is to install the Ruby interface components and the MySQL gem.

sudo apt-get install libmysql-ruby libmysqlclient-dev

sudo gem install mysql

Redmine Installation

Now you have installed all the prerequisits of Redmine, its time to get down to intalling the actual product, Redmine. You can either download the latest version of Redmine from here, and extract it to the location you are hosting your Redmine site, or like me, check it out from the SVN repository. First go to the folder you want to contain Redmine then check it out and update the owner of the new folder.

cd /path/to/your/site

sudo svn co http://redmine.rubyforge.org/svn/branches/1.0-stable redmine

sudo chown -R www-data:www-data redmine

The final “redmine” part indicates the folder you want to check out Redmine into. Assuming you’ve installed phpmyadmin to administer MySQL, fire it up and open the sql tab and enter the following to create a new database for Redmine. (If you haven’t installed phpmyadmin go to this post to ensure you have php installed, and this one to install phpmyadmin)

create database redmine character set utf8;

create user 'redmine'@'localhost' identified by 'my_password';

grant all privileges on redmine.* to 'redmine'@'localhost';

Now we have the database we need to tell Redmine all about, so we’ll jump into the Redmine folder and configure the database file.

cd redmine

sudo cp config/database.yml.example config/database.yml

sudo nano config/database.yml

This will copy the example database file and open it so you can update the file. You need to update the production section so it looks something like this:

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: my_password

Of course, you need to update it with your database details. We now need to create a session store for Redmine and create the database. This is carried out using the following commands:

rake generate_session_store

RAILS_ENV=production rake db:migrate

Now you have an empty database. This is all well and good but I suggest you load the default data in so that you get an idea of how Redmine works

RAILS_ENV=production rake redmine:load_default_data

So now we’ve pretty much done all the work to test that Redmine does in fact work the permissions and the database. We can test is using the built in WEBrick web server, which is good for testing but not for production. So lets allow it through our firewall and start it up

sudo ufw allow 3000

sudo ruby script/server webrick -e production

Now all you need to is navigate to http://localhost:3000/ and you should see Redmine. The default login details are

login: admin
password: admin

When you have finished testing press ctrl+c in the shell to stop WEBrick. I would suggest now you’ve finished testing Redmine you close the port for WEBrick

sudo ufw deny 3000

Redmine and Apache

So we have Redmine and you will quickly see that if you were to navigate to its path you won’t be able to access it. What we need to do is set up Apache to work with it. There are plenty of ways you can run Ruby on Rails applications. I prefer to use Passenger so that’s what I’ll describe here. So lets install Passenger

sudo gem install passenger

Apache unfortunately has some quirks attached to it which make using Passenger out of the box a bit of a pain, so we need to install some more components

sudo apt-get install apache2-prefork-dev libapr1-dev libaprutil1-dev

Now Apache is ready to interface with Passenger, so lets go ahead and install it

passenger-install-apache2-module

We now need to modify the Apache config files so that Passenger will handle Ruby applications when Apache is pointed to one so execute the following command

sudo nano /etc/apache2/apache2.conf

And add the following to the bottom of the file

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /usr/bin/ruby1.8

Once this is done a reboot of Apache is required to tell it we have updated its configuration.

sudo /etc/init.d/apache2 restart

Redmine is almost at the stage it can be through Apache, just a couple more steps. First open your websites config file

cd /etc/apache2/sites-available

sudo nano siteconfig.conf

And modify the file so it looks something like this

<VirtualHost *:80>
DocumentRoot /path/to/redmine/site/public
ServerName example.com
PassengerPoolIdleTime 0
<Directory "/path/to/redmine/site/public">
PassengerEnabled on
AllowOverride
Options -MultiViews
</Directory>
</VirtualHost>

Or if you access SVN from the same file like this

<VirtualHost *:80>
DocumentRoot /path/to/redmine/site/public
ServerName example.com
PassengerPoolIdleTime 0
<Directory "/path/to/redmine/site/public">
PassengerEnabled on
AllowOverride
Options -MultiViews
</Directory>

<Location /svn>
DAV svn
SVNPath /home/svn
AuthType Basic
AuthName "Your repository name"
AuthUserFile /etc/subversion/passwd
Require valid-user
</Location>
</VirtualHost>

I just want to explain a couple of things. Firstly, PassengerPoolIdleTime set to 0 means that Passenger will never close down its running applications. Secondly, PassengerEnabled on ensures that Apache understands that it need to call passenger for this directory. Finally, for me leaving AllowOverride as it is seems to work for me.

 

source: http://www.jamestoyer.me.uk/how-tos/installing-redmine-and-subversion-on-ubuntu-10-04/


 

Add your comment

Your name:
Your email:
Subject:
Comment:



Your Ad Here

Search This Website
Facebook Page

Facebook Fan Page

Follow Me on Twitter!

Donate to me
Amount: 
Boto Mo, Ipatrol Mo

Ako ang Simula

"Simulan ang pagbabago"

One year before the 2010 elections, stand up and say ENOUGH.

Advertisement
Featured Links:

Test your Internet connection quality at Pingtest.net

What is Pingtest.net?

Use Pingtest.net to determine the quality of your broadband Internet connection. Streaming media, voice, video communications, and online gaming require more than just raw speed. Test your connection now to get your Pingtest.net rating and share the result with others!


Test your Internet connection speed at Speedtest.net

What is Speedtest.net?

Use Speedtest.net to test the speed of your Internet connection. See if you are getting what you pay for or share your results with others!

PCSO Lotto Results
  • LOTTO PCSO SWERTRES 3D MAY 21, 2012
    Swertres 3 Luzon Vis-Min Morning 11:00 am: 9-2-5 Afternoon 4:00 pm: 6-4-4 Evening 9:00 pm: winning combination must be in exact order Php: 4,500 per P10 play Draws Date: 5/21/2012
  • PCSO LOTTO EZ2 RESULTS MAY 21, 2012
    Two Digit EZ2 Luzon Vismin Morning 11am: 01-23 Afternoon 4pm: 16-30 Evening 9pm: numbers must be in exact order Php 4,000.00 per P10 play Draws Date: 5/21/2012
  • SUPER LOTTO 6/49 PCSO MAY 20, 2012
    Super 6/49 Nationwide 09-47-12-30-06-01 Jackpot Prize: Php 37,607,806.80 no winner numbers in any particular order Evening Draw Date: 5/20/2012 SuperLotto consolation prizes are P56,000 for 5 winning numbers, P1000 for 4 and P100 for 3.
Yahoo! Messenger