Actions
Install-log » History » Revision 2
« Previous |
Revision 2/10
(diff)
| Next »
Anthony Mallet, 2013-12-03 13:49
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
- 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";
- Install dependencies
% 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
- 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/redmine-laas/redmine # 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
# 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.8/bin:/bin:/sbin:/usr/bin:/usr/sbin + export GEM_PATH=/opt/redmine/gems/ruby/1.8
- 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/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>
- Reload
# /etc/init.d/httpd reload
redmine pluginsredmine plugins
- git hosting hosted in
redmine-laas/scm-hosting
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 git://redmine.laas.fr/redmine-laas/scm-hosting/redmine_git_hosting % cd redmine_git_hosting % git checkout laas
- 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 almost 11 years ago · 10 revisions