Actions
Installation log¶
- Create a
git
user# useradd -d /opt/git ... git
- Get current gitolite code
# su - git % mkdir $HOME/bin $HOME/src % cd $HOME/src % git clone git://github.com/sitaramc/gitolite % $HOME/src/gitolite/install -to $HOME/bin
- Configure an admin key, will be used later by redmine
% gitolite setup -pk /some/where/id_dsa.pub
- This patch in
$HOME/.gitolite/hooks/common/update
is necessary for redmine/https commits--- update~ 2013-12-10 17:30:12.000000000 +0100 +++ update 2014-02-06 16:55:54.116934730 +0100 @@ -1,5 +1,8 @@ #!/usr/bin/perl +BEGIN { + exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK}; +} use strict; use warnings;
- Create a redmine user and the database
% 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";
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 ruby 1.9
# yum install centos-release-SCL # yum install ruby193-ruby-devel # echo source /opt/rh/ruby193/enable > /etc/profile.d/ruby193.sh
- Install dependencies
% su - # yum install curl-devel openssl-devel # yum install httpd-devel apr-devel apr-util-devel # yum install ImageMagick-devel
- Create a redmine user
% useradd -d /opt/redmine ... redmine % su - redmine # mkdir src gems files logs
- Get current redmine code - hosted in the
redmine-laas
project, branchlaas
.# cd src # git clone git://redmine.laas.fr/laas/redmine-laas/redmine laas # cd laas # git checkout laas
- Note that the
log
andplugin
directories are symlinks to$HOME
, for easier upgrades.
- Configure a few files, samples are provided in the
.example
files at the same place.# emacs config/database.yml # emacs config/configuration.yml # emacs config/additional_environment.rb
- Install some gems locally
# gem install bundler # bundle install --path /opt/redmine/gems --without development test Your bundle is complete!
- Setup PATHs etc.
# emacs ~/.profile + export PATH=opt/redmine/gems/ruby/1.9.1/bin:/bin:/sbin:/usr/bin:/usr/sbin + export GEM_PATH=/opt/redmine/gems/ruby/1.9.1 + source /opt/rh/ruby193/enable
- Some magic to setup rails/redmine etc.
# rake generate_secret_token # RAILS_ENV=production rake db:migrate # RAILS_ENV=production rake redmine:load_default_data + [en]
- Test everything is OK on
http://localhost:3000
. (not for production!)# ruby script/rails server webrick -e production
- Compile
passenger
(installed as a gem thanks toGemfile.local
in redmine (laas)% passenger-install-apache2-module
- Configure httpd.conf as follow:
# /etc/httpd/conf/httpd.conf NameVirtualHost *:80 NameVirtualHost [::]:80 NameVirtualHost *:443 NameVirtualHost [::]:443
# /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.9.1/gems/passenger-4.0.40/buildout/apache2/mod_passenger.so PassengerRoot /opt/redmine/gems/ruby/1.9.1/gems/passenger-4.0.40 PassengerDefaultRuby /opt/rh/ruby193/root/usr/bin/ruby PassengerDefaultUser redmine SetEnv PATH /opt/rh/ruby193/root/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin SetENV LD_LIBRARY_PATH /opt/rh/ruby193/root/usr/lib64 <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>
- Reload
# /etc/init.d/httpd reload
redmine pluginsredmine plugins
- git hosting hosted in
redmine-laas/plugin
project ...% 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
% git clone git://localhost/laas/redmine-laas/redmine_git_hosting % cd redmine_git_hosting
- Some magic to update redmine
% cd ~/src/redmine % bundle install % RAILS_ENV=production rake redmine:plugins:migrate % RAILS_ENV=production rake redmine:plugins:process_version_change
- Setup gitolite
# 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
- Setup (manually)
RW+
access to gitolite-admin for userredmine
- Allow
sudo
# sudo visudo + redmine ALL=(git) NOPASSWD:ALL + git ALL=(redmine) NOPASSWD:ALL
- Setup redmine user name
% git config --global user.email "redmine@laas.fr" % git config --global user.name "Redmine"
- Test
% ssh localhost info R W gitolite-admin
restart redminerestart redmine
- This works for any RoR software:
% touch /opt/redmine/src/redmine/tmp/restart.txt
Updated by Anthony Mallet over 10 years ago · 10 revisions