Redmine

From Blue-IT.org Wiki

Revision as of 11:12, 16 September 2015 by Apos (talk | contribs) (Migration)

Redmine 2.x and Ubuntu 14.04

Install Ruby 2.1

(Credits goto an excerpt from https://gist.github.com/subchen/9a78c399ec150544ac4d / THANKS)

[...]

see http://brightbox.com/docs/ruby/ubuntu/

ruby 1.9.3

sudo apt-get install ruby
sudo apt-get install ruby-dev # THIS IS IMPORTANT FOR SOME GEMS TO INSTALL !!!

ruby 2.1

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.1 
sudo apt-get install ruby2.1-dev # THIS IS IMPORTANT FOR SOME GEMS TO INSTALL !!!

switch to 2.1

sudo update-alternatives --remove ruby /usr/bin/ruby2.1
sudo update-alternatives --remove irb /usr/bin/irb2.1
sudo update-alternatives --remove gem /usr/bin/gem2.1
sudo update-alternatives \
     --install /usr/bin/ruby ruby /usr/bin/ruby2.1 50 \
     --slave /usr/bin/irb irb /usr/bin/irb2.1 \
     --slave /usr/bin/rake rake /usr/bin/rake2.1 \
     --slave /usr/bin/gem gem /usr/bin/gem2.1 \
     --slave /usr/bin/rdoc rdoc /usr/bin/rdoc2.1 \
     --slave /usr/bin/testrb testrb /usr/bin/testrb2.1 \
     --slave /usr/bin/erb erb /usr/bin/erb2.1 \
     --slave /usr/bin/ri ri /usr/bin/ri2.1
update-alternatives --config ruby
update-alternatives --display ruby

[...]

If something goes wrong with your ruby version you can manually set the links for ruby:

ln -s /usr/bin/ruby2.1 /usr/bin/ruby
ln -s /usr/bin/irb2.1 /usr/bin/irb
ln -s /usr/bin/rake2.1  /usr/bin/rake
ln -s /usr/bin/gem2.1  /usr/bin/gem
ln -s /usr/bin/rdoc2.1  /usr/bin/rdoc
ln -s /usr/bin/testrb2.1  /usr/bin/testrb
ln -s /usr/bin/erb2.1  /usr/bin/erb
ln -s /usr/bin/ri2.1  /usr/bin/ri

Update and install your bundle

Then update and install your libs necessary to run redmine - this will update and install all neccesary dependencies:

sudo cd /usr/share/redmine
sudo gem install bundler
sudo bundle install

This might give you some faults, you have to resolve and google for!

e.g. an error for the rmagick gem, after googling I resolved that with:

apt-get install libmagickwand-dev

Then again to check, if everything is in place:

sudo bundle install

Probably you need to manually create a local Gemfile (see next section about Postgresql).

Postgres

If you are using postgresql for database server:

Install the Postgres PPA:

http://www.postgresql.org/download/linux/ubuntu/

And the development files:

apt-get install postgresql-server-dev-PG_VERSION
apt-get install libdbd-pg-ruby

Create a local Gemfile:

cd /usr/share/redmine
vim Gemfile.local

# Gemfile.local
gem 'activerecord-postgresql-adapter'
gem 'pg'

Then the add the following gems

cd /usr/share/redmine
gem install pg
gem install activerecord-postgresql-adapter
bundle install

Apache 2.4

In your virtual hosts section include this:


[...] 

ServerAlias projects.yourserver.com

#  If you updated to ruby 2.1.0 - also for others!
SetEnv GEM_HOME /usr/lib/ruby/gems/2.1.0
DocumentRoot /usr/share/redmine/public
 <Directory /usr/share/redmine/public>
   Options -MultiViews
   AllowOverride All
   Require all granted
</Directory>
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn
 CustomLog /var/log/apache2/access.log combined
 ErrorLog /var/log/apache2/error.log
 ServerSignature Off

 [...]

Redmine 2.x and Ubuntu 12.04

Man problems mentioned are solved using a recent version of redmine.

Together with [Zentyal] you can use [LDAP] to authenticate users of a Samba4 domain.

Use the ppa for redmine on ubuntu 12.04 LTS and above.

Then use this guide:

Plugins

  1. Create the directory /usr/share/redmine/plugins
  2. Put plugins into this directory
  3. run the as explaned in http://www.redmine.org/projects/redmine/wiki/Plugins
rake redmine:plugins:migrate RAILS_ENV=production

LDAP with Zentyal

--Apos (talk) 10:27, 2 November 2013 (CET)

>>> See LDAP with Zentyal 3.2.

Redmine 1.x on Debian Squeeze (6.x)

Redmine Bugs

width of attached images

vim ./public/stylesheets/application.css +740
#content .wiki img {
           max-width: 98%;
}

Possible other solutions:

Fixing a bug using svn

vim /usr/share/redmine/lib/redmine/scm/adapters/subversion_adapter.rb
# SVN executable name
-        SVN_BIN = "svn"
+        SVN_BIN = "/usr/bin/svn"

Installation mit Postgresql und Apache2 mod_passenger

Prerequisites:

  • postgresql server (8.4) installation
  • apache2 with virtual hosts

Debian will configure database and permissions automatically! Be prepared to have an database password for postgres handy.

Redmine 1.1.x

apt-get install redmine redmine-pgsql ruby-git libapache2-mod-passenger librmagick-ruby

Update to the most recent version

aptitude -t squeeze-backports install redmine

Redmine 1.3.x

Or via testing:

root@server:~#  vim /etc/apt/sources.list.d/testing.list
deb http://yourmirror/debian/mirror/ testing main non-free contrib
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

and

root@server:~# vim /etc/apt/preferences.d/pinning 
Package: *
Pin: release n=squeeze
Pin-Priority: 900

Package: *
Pin: release a=testing
Pin-Priority: 80

then

root@server:~# apt-get update &&  aptitude -t testing install redmine redmine-pgsql ruby-git libapache2-mod-passenger librmagick-ruby


Trouble after install

Error with bundler

cd /usr/share/redmine
gem install bundler

Error with Gemfile.lock

Create the file:

cd /usr/share/redmine
touch Gemfile.lock
chmod 664 Gemfile.lock

And fill it with:

GEM
 remote: https://rubygems.org/
 specs:

PLATFORMS
 ruby

DEPENDENCIES

Anyway

Alter permissions.

This is NOT necessary in ubuntu 12.04 and redmine 2.x.

cd /usr/share/redmine/
mkdir files
chown -R www-data:www-data public
chown -R www-data:www-data files
chmod 777 files

Apache virtual host

SERVERIP="1.2.3.4"
MAIL="webmaster@mydomain.com"
DOMAIN="projects.example.com"
DOCPATH="/usr/share/redmine/public"
SSLPATH="/var/customers/ssl"
CUSTOMER="companyname"
CHAINFILE="/where/is/ssl/CAcert_chain.pem"

cat << EOF > ${DOMAIN}.conf
<VirtualHost ${SERVERIP}:443>
  ServerAdmin webmaster@${DOMAIN}
  ServerName  www.${DOMAIN}
  ServerAlias ${DOMAIN}

  DocumentRoot ${DOCPATH}
  <Directory ${DOCPATH}>
    Options -MultiViews
    allow from all
  </Directory>
  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog /var/log/apache2/access.log combined
  ErrorLog /var/log/apache2/error.log

  ServerSignature Off

  SSLEngine on
  SSLCertificateFile ${SSLPATH}/${CUSTOMER}/${DOMAIN}.cert
  SSLCertificateKeyFile ${SSLPATH}/${CUSTOMER}/${DOMAIN}.key
  SSLCertificateChainFile ${CHAINFILE}

</VirtualHost>
EOF

Dealing with Plugins

Mylyn Connector for Eclipse and Redmine Plugin

1. Install the Redmine Mylin Connector using the update site:

http://redmin-mylyncon.sourceforge.net/update-site/N/ 

2. Install the Redmine Plugin

cd /usr/share/redmine
ruby script/plugin install git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector
# Update
# ruby script/plugin install --force git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector

Timesheet Extension

Download the files (searching the „Downloads“ link) onto the server with

links2 https://github.com/nicStuff/redmine_timesheet_extensions

AFTER installation of plugins

Update the database

cd /usr/share/redmine
rake db:migrate_plugins RAILS_ENV=production

If you have problems use

rake db:migrate_plugins RAILS_ENV=production --trace

Some Basic Plugins

Attach Screenshot (2.x)

For Redmine 2.x (requires java 1.6++ on the client side!)

[UPDATE] Apos 12:28, 16 February 2014 (CET)

There are some problems with the new Java 1.7 security.

See my post from 2014-02-06 hoo to solve this by creating a special subfolder an link to the assets-folder and editing the security setting of java on your client computer:

The files can be loaded here - for easier working:

Close Button

* http://www.redmine.org/plugins/redmine_close_button

Ultraviolet Syntax Highlighting

* http://www.redmine.org/plugins/redmine_ultraviolet

DocPu, Document publishing plugin

* http://www.redmine.org/plugins/redmine_doc_pu

Requires:

gem install RedCloth
apt-get install tetex-base texlive-latex-extra

Hudson

* http://www.redmine.org/plugins/t-ando_redmine_hudson

Startpage (1.2.x)

* http://www.redmine.org/plugins/redmine_startpage

Books (1.2.x)

* http://www.redmine.org/plugins/redmine_wiki_books

Wiki Extensions (1.2.x)

* http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en

CMI

Be careful in production environment: Highly experimental and almost not uninstallable, once used!

Metrics

SVN integration and https

See SVN integration with apache and https


Troubeshooting

Gemfile.lock - Site won't start

Accessing the Webpage you will get:

There was an error while trying to write to Gemfile.lock. It is likely that 
you need to allow write permissions for the file at path: 

Solution:

sudo apt-get install bundler #Installs ruby-dev, which is ruby1.9-dev
sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

dpkg-reconfigure redmine witch cache cleaning

dpkg-reconfigure -plow redmine

Migration

New in 2.0.0 the plugins/engines is removed in 2.0.0.

rake db:migrate RAILS_ENV=production --trace 

Wrong version of active...

If using Redmine 2.x and

bundle show | grep active 

shows

activemodel 4.2.1

then you have to downgrade these:

vim Gemfile.local 

gem 'activerecord-mysql-adapter'
gem 'activemodel', '3.2.15'
gem 'actionpack', '3.2.15'
gem 'activesupport', '3.2.15'
gem 'ruby-mysql'

and e.g.

bundle update activemodel


Error:

gem install activemodel -v 3.2.14
gem install actionpack -v 3.2.14
gem install activeresource -v 3.2.14