Redmine Installation on Debian. v1.1

Similar documents
Installing Rails 2.3 Under CentOS/RHEL 5 and Apache 2.2

Ruby on Rails (Ruby 1.9.2, Rails 3.1.1) Installation

OPENPROJECT INSTALL ON CENTOS 7 RUNNING IN VMWARE PLAYER

Certified Redmine Project Management Professional Sample Material

TestCaseDB Administration Guide. Version 3.1

WEB2CS INSTALLATION GUIDE

Server Installation/Upgrade Guide

Apache and Virtual Hosts Exercises

Installing Rails 2.3 Under Windows XP and Apache 2.2

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Cloud Homework instructions for AWS default instance (Red Hat based)

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Installing an open source version of MateCat

ULTEO OPEN VIRTUAL DESKTOP V4.0

Installation of PHP, MariaDB, and Apache

Ubuntu Sever Administration

Rails Application Deployment. July Philly on Rails

OpenMind: Know Your Customer

Installation overview

itixi Ubuntu Server Deployment How-To/Information

SVNManager Installation. Documentation. Department of Public Health Erasmus MC University Medical Center

stub (Private Switch) Solaris 11 Operating Environment In the Solaris 11 Operating Environment, four zones are created namely:

Installing and Configuring MySQL as StoreGrid Backend Database on Linux

SNPsyn documentation. Release 1.1b. Tomaž Curk Gregor Rot Davor Sluga Uroš Lotrič Blaž Zupan

OpenGeo Suite for Linux Release 3.0

Installation Guide for AmiRNA and WMD3 Release 3.1

ANECDOTAL DEVELOPMENT & DEPLOYMENT. A Case-Study in PHP Project Workflow Lone Star PHP - June 2011 Brian Blood

Request Tracker 3.8. Stefan Hornburg. Nordic Perl Workshop Oslo, 17 th April 2009

EZcast Installation guide

escan SBS 2008 Installation Guide

Newton Linux User Group Graphing SNMP with Cacti and RRDtool

SVN Authentication and Authorization

Host your websites. The process to host a single website is different from having multiple sites.

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

SIMIAN systems. Setting up a Sitellite development environment on Mac OS X. Sitellite Content Management System

Monitoring Clearswift Gateways with SCOM

Cacti The ULTIMATE Management Solution

How To Install Amyshelf On Windows 2000 Or Later

Managing Software Projects Like a Boss with Subversion and Trac

Network Infrastructure Security Recommendations

IGEL Universal Management. Installation Guide

Back Up Linux And Windows Systems With BackupPC

Installing and Running MOVES on Linux

A Beginner's Guide to Setting Up A Web Hosting System (Or, the design and implementation of a system for the worldwide distribution of pictures of

Installation documentation for Ulteo Open Virtual Desktop

Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L

ALERT installation setup

Install Apache on windows 8 Create your own server

CN=Monitor Installation and Configuration v2.0

Backing up the Embedded Oracle database of a Red Hat Network Satellite

User Manual of the Pre-built Ubuntu 9 Virutal Machine

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

Ulteo Open Virtual Desktop Installation

Moving to Plesk Automation 11.5

LAMP Quickstart for Red Hat Enterprise Linux 4

Livezilla How to Install on Shared Hosting By: Jon Manning

Version Control with Subversion

ABS Manual Installation Guide

CO Web Server Administration and Security. By: Szymon Machajewski

Getting Started in Red Hat Linux An Overview of Red Hat Linux p. 3 Introducing Red Hat Linux p. 4 What Is Linux? p. 5 Linux's Roots in UNIX p.

Advantech AE Technical Share Document

Recommended File System Ownership and Privileges

Installing Booked scheduler on CentOS 6.5

Rsync: The Best Backup System Ever

Load Balancing/High Availability Configuration for neoninsight Server

INSTALLATION GUIDE VERSION

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

Implementing a Weblogic Architecture with High Availability

Open-Xchange Server Backup Whitepaper

MySQL Backups: From strategy to Implementation

How To Set Up A Backupassist For An Raspberry Netbook With A Data Host On A Nsync Server On A Usb 2 (Qnap) On A Netbook (Qnet) On An Usb 2 On A Cdnap (

NATIONAL POPULATION REGISTER (NPR)

Building Website with Drupal 7

Bitrix Site Manager ASP.NET. Installation Guide

Partek Flow Installation Guide

Rancid Server Build and Operation Overview (v0.3) (This is being done from memory so expect some errors)

Installation and Control in Linux

Expresso Quick Install

Desktop : Ubuntu Desktop, Ubuntu Desktop Server : RedHat EL 5, RedHat EL 6, Ubuntu Server, Ubuntu Server, CentOS 5, CentOS 6

Scala InfoChannel Content Manager 5 Backup and Restore Instructions

Implementing Failover Capabilities in Red Hat Network Satellite

Setting Up Specify to use a Shared Workstation as a Database Server

This appendix describes the following procedures: Cisco ANA Registry Backup and Restore Oracle Database Backup and Restore

Redatam+SP REtrieval of DATa for Small Areas by Microcomputer

Installing Dspace 1.8 on Ubuntu 12.04

Building Ruby, Rails, LightTPD, and MySQL on Tiger

Using Symantec NetBackup with Symantec Security Information Manager 4.5

INSTALL ZENTYAL SERVER

42goISP Documentation

Backing Up TestTrack Native Project Databases

StoreGrid Backup Server With MySQL As Backend Database:

VERSION 9.02 INSTALLATION GUIDE.


VoIP monitor sniffer manual

Getting an ipath server running on Linux

Transcription:

Redmine Installation on Debian v1.1 Introduction 1. Objectives Have a fully functional Redmine installation on a dedicated server with good performance. The idea of this document came after an easy installation that use fastcgi and was nor easy nor fast! So I decided to write this documentation about how to be able to install Redmine from the beginning to the very end. 2. Presentation of the Document As this document describes the Redmine installation process for a specific environment, it is divided into two parts. The first part gives the basic clues for a fully functional installation. The second part details the action taken to tune the server and adds some backup facilities. 3. Choices Technology Linux Debian MySQL Apache2 Passenger Subversion Details Stability! The database recommended for Redmine Standard and robust web server Integration of Rails into Apache with good performance The source control used for my projects 1 / 12

Summary Introduction... 1 1. Objectives... 1 2. Presentation of the Document... 1 3. Choices... 1 Summary... 2 Installation Steps... 3 1. Initial Download... 3 2. Install Debian... 3 3. Install and Configure MySQL... 4 4. Install Ruby Packages... 4 5. Install Passenger (aka mod_rails)... 5 6. Install Redmine... 5 7. Configure Apache... 6 8. Subversion (svnserve)... 7 Tuning Steps... 8 1. Apache... 8 2. Passenger... 8 3. Subversion... 9 Backup... 10 1. Preparation... 10 2. MySQL Configuration... 10 3. Full Backup... 11 4. Incremental Backup... 11 5. Cron... 11 2 / 12

Installation Steps 1. Initial Download There is only one initial download for this installation: Debian Lenny 5.0.1 - debian-501-i386-businesscard.iso 2. Install Debian The Debian server is installed with the classic installation process and without any special commands or actions. This way we could have quickly a functional environment and tune it afterward. The first questions depend of your own regional settings, your own network settings and your own installation procedure. Your choices have no impact on the Redmine installation process. For your information, here are my choices: Language: English Country: Luxembourg Keyboard map: French Hostname: Debian Domain: Belkin Mirror: ftp.debian.skynet.be Proxy: without proxy Partionning: entire disk, one primary partition Root password: ***** User name: debian User login: debian User password: ***** Popularity Context: No The first question that matter is the one about the packages to install. You need to select the options Web Server and Standard system. All others are optional and depend of your own procedures (Don t hesitate to ignore them). For your information, here are the soft installed by those packages: Desktop environment: gnome Web server: apache2 Print server: cups DNS server: bind9 File server: samba, nfs Mail server: exim4, spamassassin, uw-imap SQL database: postgresql Laptop: bluetooth, hibernate, Standard system: ftp, telnet, whois, doc-debian, 3 / 12

Finalize the wizard. Eject. Reboot. First step finished! You have a Debian server. More Information: http://www.debian.org/releases/stable/i386/ch06s03.html 3. Install and Configure MySQL Debian provides a standard mysql-server package that will install the version 5.0.51a-24. aptitude install mysql-server The default data path is /var/lib/mysql and the configuration can be found in /etc/mysql. The next step is to create the initial database and the associated user: mysql -p create database redmine character set utf8; grant all on redmine.* to redmine identified by ***** ; As the default storage engine is MyISAM and as I want a system that I can rely on (with transactions and foreign keys in fact): I switch the default storage engine to InnoDB. This step is optional, but essential in my point-of-view. For this, I create a file /etc/mysql/conf.d/innodb.cnf that contains the following lines: [mysqld] default-storage-engine = InnoDB Do it if as me you prefer InnoDB to MyISAM and then restart the server: /etc/init.d/mysql restart 4. Install Ruby Packages The Redmine 0.8.x requirements are: Ruby 1.8.6 or 1.8.7, Rails 2.1.2, RubyGems 1.3.1, Rake 0.8.3 The associated Debian packages are: Package Version Details ruby 1.8.7.72-3 rails 2.1.0-6 Dependency to ruby and rake rubygems 1.2.0-3 Dependency to ruby rake 0.8.1-3 Dependency to ruby 4 / 12

It s not exactly the mandatory versions but the most important is to install the good version of Rails. For this reason, Rails will be installed with gem and not with apt. aptitude install ruby rake rubygems aptitude install libmysql-ruby libopenssl-ruby gem install rails v=2.1.2 5. Install Passenger (aka mod_rails) To install Passenger, we will have to compile it from its source code as there is no existing package for Debian. So we need a compiler and the mandatory libraries. aptitude install g++ make ruby-dev apache2-dev gem install passenger cd /var/lib/gems/1.8/gems/passenger-2.2.1/bin./passenger-install-apache2-module As the path of passenger is a little bit complicated, I decide to create a link into /usr/local/lib. A second option could be a movement of all the files as described in the Passenger documentation (http://www.modrails.com/documentation/users%20guide.html#_moving_phusion_passenger_to_a _different_directory). ln -s /var/lib/gems/1.8/gems/passenger-2.2.1 /usr/local/lib/passenger The Passenger installer gives some instructions to activate the mod into the Apache configuration. To respect the current Apache architecture, the deployment of the new mod configuration will be done by creating two files: passenger.conf and passenger.load in the /etc/apache2/mods-available directory. passenger.load LoadModule passenger_module /usr/local/lib/passenger/ext/apache2/mod_passenger.so passenger.conf PassengerRoot /usr/local/lib/passenger-2.2.1 PassengerRuby /usr/bin/ruby1.8 PassengerDefaultUser www-data To activate the mod, a link needs to be created into the mods-enabled directory. cd /etc/apache2/mods-enabled ln s../mods-available/passenger.load ln s../mods-available/passenger.conf /etc/init.d/apache2 reload More information: http://modrails.com/documentation/users%20guide.html 6. Install Redmine By downloading Redmine from its subversion repository, you could be easily deployed the future point releases. aptitude install subversion 5 / 12

cd /usr/local/lib svn co http://redmine.rubyforge.org/svn/branches/0.8-stable redmine- 0.8 Next, you need to connect Redmine to its database by creating a database.yml file. cd /usr/local/lib/redmine-0.8 cp config/database.yml.example config/database.yml vi config/database.yml The default configuration uses the root user without password. You need to configure the production information in the database.yml file to have a configuration like this one:... production: adapter: mysql database: redmine host: localhost username: redmine password: ***** encoding: utf8... Now you can populate the database with its default tables and data. rake db:migrate RAILS_ENV="production" rake redmine:load_default_data RAILS_ENV="production" The selection of a language is only a default choice as all the language will be installed, and you will be able to change your mind latter via the administration of Redmine. Source: http://www.redmine.org/wiki/redmine/redmineinstall 7. Configure Apache As the user that runs both Apache and Passenger is www-data, it requires some rights on the Redmine web site folders. cd /usr/local/lib/redmine-0.8 mkdir tmp public/plugin_assets chown -R rwww-data:www-data files log tmp public/plugin_assets chmod -R 755 files log tmp public/plugin_assets Finally, configure Apache to work with this web site by creating a file /etc/apache2/sitesavailable/redmine with the following content: <VirtualHost *:80> DocumentRoot /usr/local/lib/redmine-0.8/public <Directory /usr/local/lib/redmine-0.8/public> AllowOverride None </Directory> </VirtualHost> To enable this site, create a link into the directory sites-enabled. 6 / 12

cd /etc/apache2/sites-enabled rm 000-default ln s../sites-available/redmine 000-redmine /etc/init.d/apache2 reload Done! Launch your favorite browser and enjoy Redmine! 8. Subversion (svnserve) To use svnserve as a daemon, the first step is to create the associated script in /etc/init.d. cp /etc/init.d/skeleton /etc/init.d/svnserve chmod +x /etc/init.d/svnserve After the edition of this file, we will be able to have a fully functional Subversion server easily. Here are the values for the modified variables of the script: DESC= Subversion server NAME=svnserve DAEMON=/usr/bin/$NAME DEAMON_ARGS= -d r /var/local/svn Now, the daemon needs to be deployed on the rc.xx.d directories. update-rc.d svnserve defaults 7 / 12

Tuning Steps 1. Apache The configuration done just before is really light. Here is a sample of a much better configuration for the file /etc/apache2/sites-available/redmine : <VirtualHost *:80> DocumentRoot /usr/local/lib/redmine-0.8/public ServerSignature off <Directory /> Order Deny,Allow Deny from all </Directory> <Directory /usr/local/lib/redmine-0.8/public> AllowOverride None Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/redmine-error.log CustomLog /var/log/apache2/redmine-access.log combined </VirtualHost> More information: http://httpd.apache.org/docs/2.2/ 2. Passenger The configuration for Passenger could be improved by reducing a DoS risk and by globalize the queue of the Passenger threads. For this, the new /etc/apache2/mods-available/passenger.conf configuration file is: <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/passenger-2.2.1 PassengerRuby /usr/bin/ruby1.8 PassengerDefaultUser www-data PassengerUserSwitching off PassengerUseGlobalQueue on PassengerRestartDir /var/local/passenger </IfModule> And we need to create the associated restart.txt file. mkdir /var/local/passenger > /var/local/passenger/restart.txt More information: http://www.modrails.com/documentation/users%20guide.html 8 / 12

3. Subversion To simply the creation of new projects on Subversion, I have created a svn-create-project.sh script in /usr/local/bin/ that does the following actions: Create the new project in the Subversion repository, Prepare its configuration and use a unique password file, Initialize its directory hierarchy with branches, tags and trunk folders, Create a post-commit hook that updates Redmine on each commit, Create a pre-commit hook that checks that each commit have a message. /usr/local/bin/svn-create-project.sh #!/bin/sh if [ $1 == ] then echo missing project name else SVN_REP=/var/local/svn svnadmin create $SVN_REP/$1 cp $SVN_REP/.config/svnserve.conf $SVN_REP/$1/conf cp $SVN_REP/.config/hooks/ * $SVN_REP/$1/hooks rm $SVN_REP/$1/conf/passwd svn import $SVN_REP/.config/initial file://$svn_rep/$1 --message Initial directories fi As you can see this script use a special directory (.config ) created into the Subversion repository. This directory is created via the following commands: mkdir /var/local/svn/.config mkdir /var/local/svn/.config/initial mkdir /var/local/svn/.config/initial/branches mkdir /var/local/svn/.config/initial/tags mkdir /var/local/svn/.config/initial/trunk mkdir /var/local/svn/.config/hooks This special directory contains the following 2 files: the passwd that are common to all projects and the svnserve.conf that will be used to initialize all the projects. /var/local/svn/.config/passwd [users] redmine = ***** francois = ***** /var/local/svn/.config/svnserve.conf [general] password-db =../../.config/passwd 9 / 12

Finally, the.config/hook directory contains a post-commit and a pre-commit hooks. /var/local/svn/.config/hooks/post-commit #!/bin/sh REPOS= $1 REV= $2 REDMINE= /usr/local/lib/redmine-0.8 /usr/bin/ruby $REDMINE/script/runner "Repository.fetch_changesets" -e production /var/local/svn/.config/hooks/pre-commit #!/bin/sh REPOS= $1 TXN= $2 /usr/bin/svnlook log t $TXN $REPOS \ grep [a-za-z0-9] > /dev/null exit 1 exit 0 As those scripts will be executed, don t forget to give it the executable right. chmod +x post-commit chmod +x pre-commit Backup 1. Preparation The idea is to create a full backup each day with an incremental backup each hour. The proposed system is really simple because I don t want to go to high availability (and create a slave server) and because my directory /backup could be itself secured by other tools. To prepare my backup scripts, I need rsync but it is not part of the default installation of Debian. aptitude install rsync Now, I need to create the directory hierarchy for the backup. mkdir /backup mkdir /backup/redmine mkdir /backup/redmine/files mkdir /backup/redmine/mysql 2. MySQL Configuration MySQL needs to be configured because incremental backup is available on MySQL only if the binary logs is enabled. 10 / 12

For this, create an etc/mysql/conf.d/backup.cnf file with the following lines: [mysqld] log_bin=redmine-bin expire_logs_days=2 And restart the server. /etc/init.d/mysqld restart Source: http://dev.mysql.com/doc/mysql-security-excerpt/5.0/en/backup.html 3. Full Backup For the full backup script, I create a file /usr/local/bin/redmine-backup-full.sh with the following code: #!/bin/sh # Redmine Attachments rsync -a /usr/local/lib/redmine-0.8/files /backup/redmine/files # MySQL Extract mysqldump password=**** --single-transaction --quick -flush-logs -- master-data=2 --delete-master-logs redmine gzip > /backup/redmine/mysql/`date +%Y%m%d`.gz rm f /backup/redmine/mysql/redmine-bin* The file needs to be registered as an executable. chmod +x /usr/local/bin/redmine-backup-full.sh 4. Incremental Backup For the incremental backup script, I create a file /usr/local/bin/redmine-backup-incremental.sh with the following code: #!/bin/sh # Redmine Attachments rsync -a /usr/local/lib/redmine-0.8/files /backup/redmine/files # MySQL Incremental Backup rsync a /var/lib/mysql/redmine-bin* /backup/redmine/mysql The file needs to be registered as an executable. chmod +x /usr/local/bin/redmine-backup-incremental.sh 5. Cron Last thing to do: schedule the backup tasks. Without any surprise, we do this with cron. The standard command for editing cron scheduling is: crontab e 11 / 12

And here is the schedule data for those tasks: # min hour dom mon dow command 0 1 * * * redmine-backup-full.sh 30 * * * * redmine-backup-incremental.sh 12 / 12