Project

General

Profile

InstallRedmineOnDebianStableApacheMysqlPassenger » History » Revision 3

Revision 2 (Jan Niggemann (redmine.org team member), 2013-01-21 22:24) → Revision 3/32 (Jan Niggemann (redmine.org team member), 2013-01-22 11:26)

h1. InstallRedmineOnDebianStableApacheMysqlPassenger DebianInstall 

 Last updated: January 2012 {{>toc}} 

 h1. Chapter 0: Preface 

 h2. About this guide 

 This is a step-by-step guide to install redmine on "Debian stable" (called Squeeze at the moment of writing). 
 It is written for people who are familiar with Debian, the shell, MySQL, Apache and Linux in general. 
 To keep this guide short, it does not explain every step in detail, but *after reading, even novices should end up with a working redmine instance*. 

 *%{color:red}Please note:%* We're assuming that you know how to use the tools at hand. If that's not the case (eg. you don't know how to create a new database or you don't know how to restart apache) please use the search engine of your choice and come back afterwards. 

 h1. Chapter 1: Install ruby, rails, gems and passenger 

 {{collapse(Read chapter 1) 

 h2. 1.1 Prepare your system 

 <pre>apt-get install gcc build-essential zlib1g zlib1g-dev zlibc libzlib-ruby libssl-dev libyaml-dev libcurl4-openssl-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev</pre> 

 h2. 1.2 download, build and install ruby 

 <pre>wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz 
 tar xvfz ruby-1.9.3-p327.tar.gz 
 cd ruby-1.9.2-p0 
 ./configure --enable-pthread --prefix=/usr/local 
 make && make install</pre> 

 h2. 1.3 check if ruby works 

 <pre>ruby –v</pre> 

 h2. 1.4 make ruby support OpenSSL 

 <pre>cd ruby-1.9.2-p0 
 cd ext/openssl/ 
 ruby extconf.rb 
 make && make install</pre> 

 h2. 1.5 gem installed? 

 By now, gem should already be installed, check: 
 <pre>gem -v</pre> 

 h2. 1.6 install rails 

 <pre>gem install rails</pre> 

 h2. 1.7 install passenger (application server) 

 <pre>gem install passenger 
 passenger-install-apache2-module</pre> 

 h2. 1.8 configure apache 

 Put this in /etc/apache/mods-available/passenger.load 
 <pre>LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.18/ext/apache2/mod_passenger.so</pre> 

 And put this in /etc/apache/mods-available/passenger.conf 
 <pre>PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.18 
 PassengerRuby /usr/local/bin/ruby 
 PassengerDefaultUser www-data</pre> 


 h2. 1.9 activate module 

 <pre>a2enmod passenger</pre> 

 }} 

 h1. Chapter 2: Install redmine 

 {{collapse(Read chapter 2) 

 h2. 2.1 download redmine 

 Get latest zip from "here":http://rubyforge.org/frs/?group_id=1850 and unpack to /opt 

 h2. 2.2 further prepare the system 

 Note: Installing @libmagick9-dev@ installs a lot of packages (depends / recommends) 
 <pre>gem install bundler 
 apt-get install libmagick9-dev 
 bundle install --without postgresql</pre> 

 h2. 2.3 create databases 

 We now create 2 databases, one for production and one for development. 
 I won't give detailed instructions on how to use mysql, please use you favorite search engine to find information you need. 

 <pre>create database redmine character set utf8; 
 create database redmine_dev character set utf8; 
 create user 'redmine'@'localhost' identified by 'XXX'; 
 grant all privileges on redmine.* to 'redmine'@'localhost'; 
 grant all privileges on redmine_dev.* to 'redmine'@'localhost';</pre> 


 h2. 2.4 configure DB-connection 

 Put this in /opt/redmine/config/database.yml 
 <pre>production: 
 adapter: mysql2 
 database: redmine 
 host: localhost 
 username: redmine 
 password: my_password</pre> 

 h2. 2.5 generate a session store secret 

 <pre>rake generate_secret_token</pre> 

 h2. 2.6 prepare database / create tables 

 <pre>RAILS_ENV=production rake db:migrate</pre> 

 h2. 2.7 set filesystem permissions 

 <pre>mkdir /opt/redmine/plugin_assets (oder public/plugin_assets?) 
 chown www-data:www-data /opt/redmine/plugin_assets</<pre> 

 h2. 2.8 test if it works 
 <pre>ruby script/rails server webrick -e production</<pre> 
 Now go to http://localhost:3000 and see redmine in action. 

 }} 

 h1. Chapter 3: Configure apache and passenger 

 In this guide, we deploy to a sub-URI. Read other guides if you want a name-based virtual host configuration. 

 {{collapse(Read chapter 3) 

 h2. Deployment in subURI 
 <pre> 
 ln -s /opt/redmine/public /var/www/redmine 

 /etc/apache2/sites-available/redmine 

 [Location /redmine-dev] 
   RailsEnv development 
		 RailsBaseURI /redmine-dev 
		 Options –MultiViews 
 [/Location] 
 [Location /redmine] 
		 RailsEnv production 
		 RailsBaseURI /redmine 
		 Options –MultiViews 
 [/Location] 
 </pre> 

 }}