Archive

Posts Tagged ‘project management’

Configuration of Redmine on Ubuntu

April 3, 2010 2 comments

Pre-requisite packages:-

Update your repository

# apt-get update && apt-get upgrade

Following packages are required from the redmine

# sudo apt install apache2 libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl subversion libapache2-svn apache2-threaded-dev

# sudo apt install ruby ruby1.8-dev rubygems rubygems1.8 ruby-pkg-tools libgemplugin-ruby libgemplugin-ruby1.8  libruby-extras libruby1.8-extras rails rake

# sudo apt install build-essential libdbd-pg-perl mysql-server

Install a couple of gems

# sudo gem install rails mongrel mongrel_cluster mysql –include-dependencies

Add gems to $PATH

Temporarily

PATH =$PATH: /home/qasim/.gem/ruby/version/bin/

export PATH

Permanently

Add the following line at the end of the /etc/profile file

export PATH=$PATH: /home/qasim/.gem/ruby/version/bin/

Downloading Redmine:-

Using tar file

$ mkdir /var/www/redmine

$ cd /var/www/redmine

$ wget http://rubyforge.org/……../redmine-version.tar.gz

$ sudo tar xvfz redmine-versiontar.gz

$ sudo mv redmine-version/* .;rm redmine-version.tar.gz -rf

$ sudo chown www-data:www-data * . -R

Using svn repo

For this setup I’ll be using the 0.6 stable branch of redmine via svn, and installing it under /var/www/rails_apps/redmine-0.6

Create the directory and checkout Redmine

$ mkdir /var/www/redmine

$ cd /var/www/redmine

$ svn co http://redmine.rubyforge.org/svn/branches/0.6-stable redmine-version

Configuring Redmine:

Set up the database for Redmine to use

We’ll create a database for redmine by logging into mysql server

$ mysql –u root –p

mysql> create database redmine character set utf8;

Query OK, 1 row affected (0.04 sec)

mysql> exit

Bye

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for “production” environment.

/var/www/redmine$ sudo cp config/database.yml.example config/database.yml

Now open the databse.yml file and edit it according to your credentials

production:

adapter: mysql

database: redmine

host: localhost

username: redmine

password: XXXXXXXX

encoding: utf8

socket: /var/run/mysqld/mysqld.sock

Create the database structure, by running the following command under the application root directory (/var/www/redmine)

# sudo rake db:migrate RAILS_ENV=”production”

Insert default configuration data in database, by running the following command:

# sudo rake redmine:load_default_data RAILS_ENV=”production”

Errors

Error reading /home/qasim/.nano_history: Permission denied

Run the rake command with root permissions

Access denied for user ‘root’@’localhost’ (using password: NO)

Either password in database .yml is incorrect or you forgot to write it in

Now it’s the time to test the beast performance let’s confirm that every nut and bolt is in place.

Trigger the following while living in the same /var/www/redmine:

$ sudo mongrel_rails start –environment=production

Output

** Starting Mongrel listening at 0.0.0.0:3000

** Starting Rails with production environment…

** Rails loaded.

** Loading any Rails specific GemPlugins

** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).

** Rails signals registered.  HUP => reload (without restart).  It might not work well.

** Mongrel 1.1.5 available at 0.0.0.0:3000

** Use CTRL-C to stop.

Switch to your favorite browser and point it to localhost:3000 with the following credentials to access the administrator’s dashboard.

web address: http://localhost:3000

username: admin

password: admin

happy mining :p

%d bloggers like this: