Project

General

Profile

Install-log » History » Revision 2

Revision 1 (Anthony Mallet, 2013-12-03 13:28) → Revision 2/10 (Anthony Mallet, 2013-12-03 13:49)

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) 
 * 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/redmine-laas/redmine 
 # 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 # test on @http://localhost:3000@. (not for production!) http://localhost:3000 with: 
 <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 plugins 
 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/redmine/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/redmine/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/scm-hosting@ 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://github.com/jbox-web/redmine_git_hosting 
 </pre> 
  <pre> 
 % git clone git://redmine.laas.fr/redmine-laas/scm-hosting/redmine_git_hosting git://github.com/jbox-web/redmine_plugin_views_revisions 
 % cd redmine_git_hosting 
 % git checkout laas 
 </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 


 # redmine + 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 config 
  + Host localhost 
  +    User git 
  +    IdentityFile /opt/redmine/.ssh/gitolite_admin_rsa 
  +    IdentitiesOnly yes 
 </pre> 

 * Setup (manually) @RW+@ echo "setup RW+ access to gitolite-admin for user @redmine@ redmine" | brain 

 * 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 # test with: 
 <pre> 
 % ssh localhost info 
   
  ->    R W      gitolite-admin 


 # apache 
 </pre> su - 
 }} emacs /etc/httpd/conf/httpd.conf 
  + NameVirtualHost *:80 
  + NameVirtualHost [::]:80 
  + NameVirtualHost *:443 
  + NameVirtualHost [::]:443 

 {{collapse(restart redmine) emacs /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/redmine/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.2\ 
  + 4/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/redmine/public> 
  +           AllowOverride all 
  +           Options -MultiViews 
  +           Allow from all 
  +       </Directory> 
  + </VirtualHost> 
  + 
  + <VirtualHost *:80 [::]:80> 
  +       ServerName redmine.laas.fr 
  +       Redirect permanent / https://redmine.laas.fr/ 
  + </VirtualHost> 

 * This works /etc/init.d/httpd reload 

 # to restart redmine (works for any RoR software: software): 
 <pre> 
 % touch /opt/redmine/src/redmine/tmp/restart.txt 
 </pre> 
 }}