Project

General

Profile

Install-log » History » Revision 6

Revision 5 (Anthony Mallet, 2014-01-21 12:25) → Revision 6/10 (Anthony Mallet, 2014-02-11 18:02)

h1. Installation log 

 {{collapse(gitolite) 

 * Create a @git@ user 
 <pre> 
 # useradd -d /opt/git ... git 
 </pre> 

 * Get current gitolite code 
 <pre> 
 # su - git 
 % mkdir $HOME/bin $HOME/src 
 % cd $HOME/src 
 % git clone git://github.com/sitaramc/gitolite 
 % $HOME/src/gitolite/install -to $HOME/bin 
 </pre> 

 * Configure an admin key, will be used later by redmine 
 <pre> 
 % gitolite setup -pk /some/where/id_dsa.pub 
 </pre> 
 }} 

 {{collapse(postgres) 
 * Create a redmine user and the database 
 <pre> 
 % psql -U ... 
 % create role redmine login encrypted password '...secret...' noinherit valid until 'infinity'; 
 % create database redmine with encoding='UTF8' owner=redmine; 
 % [this is the default, but to be sure: ALTER DATABASE "redmine" SET datestyle="ISO,MDY"; 
 </pre> 
 }} 

 {{collapse(redmine) 

 There are two identical installations. One for redmine.laas.fr and one for openrobots.org. They are called @laas@ and @openrobots@ respectively. Only the @laas@ setup is detailed here. @openrobots@ setup is identical. 

 * Install dependencies 
 <pre> 
 % su - 
 # yum install curl-devel openssl-devel 
 # yum install httpd-devel apr-devel apr-util-devel 
 # yum install ruby-devel rubygems rubygem-rake ImageMagick-devel 
 # gem install bundler 
 </pre> 

 * Create a redmine user 
 <pre> 
 % useradd -d /opt/redmine ... redmine 
 % su - redmine 
 # mkdir src gems files logs 
 </pre> 

 * Get current redmine code - hosted in the @redmine-laas@ project, branch @laas@. 
 <pre> 
 # cd src 
 # git clone git://redmine.laas.fr/laas/redmine-laas/redmine laas 
 # cd laas 
 # git checkout laas 
 </pre> 

 * Note that the @log@ and @plugin@ directories are symlinks to @$HOME@, for easier upgrades. 

 * Configure a few files, samples are provided in the @.example@ files at the same place. 
 <pre> 
 # emacs config/database.yml 
 # emacs config/configuration.yml 
 # emacs config/additional_environment.rb 
 </pre> 

 * Install some gems locally 
 <pre> 
 # bundle install --path /opt/redmine/gems --without development test 
 Your bundle is complete! 
 </pre> 

 * Setup PATHs etc. 
 <pre> 
 # emacs ~/.profile 
  + export PATH=opt/redmine/gems/ruby/1.8/bin:/bin:/sbin:/usr/bin:/usr/sbin 
  + export GEM_PATH=/opt/redmine/gems/ruby/1.8 
 </pre> 

 * Some magic to setup rails/redmine etc. 
 <pre> 
 # rake generate_secret_token 
 # RAILS_ENV=production rake db:migrate 
 # RAILS_ENV=production rake redmine:load_default_data 
  + [en] 
 </pre> 

 * Test everything is OK on @http://localhost:3000@. (not for production!) 
 <pre> 
 # ruby script/rails server webrick -e production 
 </pre> 
 }} 

 {{collapse(apache) 
 * Compile @passenger@ (installed as a gem thanks to @Gemfile.local@ in redmine (laas) 
 <pre> 
 % passenger-install-apache2-module 
 </pre> 

 * Configure httpd.conf as follow: 
 <pre> 
 # /etc/httpd/conf/httpd.conf 
 NameVirtualHost *:80 
 NameVirtualHost [::]:80 
 NameVirtualHost *:443 
 NameVirtualHost [::]:443 
 </pre> 

  <pre> 
 # /etc/httpd/conf.d/redmine.conf 
 <VirtualHost *:443 [::]:443> 
     SSLEngine on 
     SSLCertificateFile /etc/pki/tls/certs/localhost.crt 
     SSLCertificateKeyFile /etc/pki/tls/private/localhost.key 

     ServerName redmine.laas.fr 
     ServerAdmin sysadmin@laas.fr 
     DocumentRoot /opt/redmine/src/laas/public 
     ErrorLog /opt/redmine/logs/httpd-errors 
     CustomLog /opt/redmine/logs/httpd-access common 

     LoadModule passenger_module /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24/buildout/apache2/mod_passenger.so 
     PassengerRoot /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24 
     PassengerDefaultRuby /usr/bin/ruby 
     PassengerDefaultUser redmine 

     <Directory /opt/redmine/src/laas/public> 
         AllowOverride all 
         Options -MultiViews 
         Allow from all 
     </Directory> 
 </VirtualHost> 

 <VirtualHost *:80 [::]:80> 
     ServerName redmine.laas.fr 
     Redirect permanent / https://redmine.laas.fr/ 
 </VirtualHost> 
 </pre> 

 * Reload 
 <pre> 
 # /etc/init.d/httpd reload 
 </pre> 
 }} 

 {{collapse(redmine plugins) 
 * git hosting hosted in @redmine-laas/plugin@ project ... 
 <pre> 
 % cd ~/plugins 
 % git clone git://github.com/thorin/redmine_ldap_sync 
 % git clone git://github.com/jbox-web/redmine_plugin_views_revisions 
 % git clone https://github.com/cdwertmann/recaptcha.git 
 </pre> 
  <pre> 
 % git clone git://localhost/laas/redmine-laas/redmine_git_hosting 
 % cd redmine_git_hosting 
 </pre> 

 * Some magic to update redmine 
 <pre> 
 % cd ~/src/redmine 
 % bundle install 
 % RAILS_ENV=production rake redmine:plugins:migrate 
 % RAILS_ENV=production rake redmine:plugins:process_version_change 
 </pre> 

 * Setup gitolite 
 <pre> 
 # su - redmine 
 % mkdir .ssh 
 % ssh-keygen -N '' -f ~/.ssh/gitolite_admin_rsa # use the same key as already in gitolite 
 % emacs ~/.ssh/config 
  + Host localhost 
  +    User git 
  +    IdentityFile /opt/redmine/.ssh/gitolite_admin_rsa 
  +    IdentitiesOnly yes 
 </pre> 

 * Setup (manually) @RW+@ access to gitolite-admin for user @redmine@ 

 * Allow @sudo@ 
 <pre> 
 # sudo visudo 
  + redmine          ALL=(git)        NOPASSWD:ALL 
  + git              ALL=(redmine)    NOPASSWD:ALL 
 </pre> 

 * Setup redmine user name 
 <pre> 
 % git config --global user.email "redmine@laas.fr" 
 % git config --global user.name "Redmine" 
 </pre> 

 * Test 
 <pre> 
 % ssh localhost info 
   R W      gitolite-admin 
 </pre> 
 }} 

 {{collapse(restart redmine) 

 * This works for any RoR software: 
 <pre> 
 % touch /opt/redmine/src/redmine/tmp/restart.txt 
 </pre> 
 }}