Install-log » History » Revision 9
Revision 8 (Anthony Mallet, 2014-03-19 11:42) → Revision 9/10 (Anthony Mallet, 2014-07-15 13:03)
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> * This patch in @$HOME/.gitolite/hooks/common/update@ is necessary for redmine/https commits <pre> --- 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; </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 ruby 1.9 <pre> # yum install centos-release-SCL # yum install ruby193-ruby-devel # echo source /opt/rh/ruby193/enable > /etc/profile.d/ruby193.sh </pre> * 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> # gem install bundler # 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.9.1/bin:/bin:/sbin:/usr/bin:/usr/sbin PATH=opt/redmine/gems/ruby/1.8/bin:/bin:/sbin:/usr/bin:/usr/sbin + export GEM_PATH=/opt/redmine/gems/ruby/1.9.1 + source /opt/rh/ruby193/enable 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.9.1/gems/passenger-4.0.40/buildout/apache2/mod_passenger.so /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24/buildout/apache2/mod_passenger.so PassengerRoot /opt/redmine/gems/ruby/1.9.1/gems/passenger-4.0.40 /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24 PassengerDefaultRuby /opt/rh/ruby193/root/usr/bin/ruby /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> </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> }}