Gitorious

This is for setting up Gitorious on Centos 6.

Based on the guide here: http://famousphil.com/blog/2011/06/installing-gitorious-on-centos-5-6-x64/

Installation

prep

  1. might as well enable eth0 (or make sure it is enabled, brainiac is registered)
  2. install rpmforge, set the following to includepkgs:
    • apg libyaml* GeoIP* sphinx
  3. install:
    yum install git-core git-svn java-1.6.0-openjdk apg pcre pcre-devel zlib zlib-devel libyaml-devel GeoIP-devel sphinx mysql-devel mysql-server mysql
  4. install:
    yum install -y tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel ImageMagick-devel
  5. yum install rubygems ruby-devel
  6. (for nokogiri gem) yum install gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
  7. yum install -y httpd httpd-devel mod_ssl mod_xsendfile (add mod_xsendfile to epel.repo)
  8. yum install rubygem-rake libcurl-devel
  9. install remi repo:
    yum install /src/files/repos/rhel6/remi-release-6.rpm
  10. add git user, and setup some directories:
    # useradd -d /home/git git
    # su - git
    $ mkdir {log,conf}
    $ mkdir -p data/{repos,tarballs,tarballs-work}
  11. fix perms:
    # chmod 755 /home/git
    # chmod 777 /home/git/data/
  12. setup ssh keys
  13. setup sshd_config for keys
  14. setup ssh_config KeySign crap

MySQL

  1. start mysql, and run the initial setup (answer yes to the prompts after setting password):
    # service mysqld start
    # /usr/bin/mysql_secure_installation
  2. configure mysql (settings for database.yml as well):
    # mysql -u root -p
    mysql> create database gitorious;
    mysql> create database gitorious_test;
    mysql> create database gitorious_dev;
    mysql> CREATE user 'git'@'localhost' IDENTIFIED BY '<PASWORD>';
    mysql> GRANT ALL ON gitorious.* TO 'git'@'localhost';
    mysql> GRANT ALL ON gitorious_test.* TO 'git'@'localhost';
    mysql> GRANT ALL ON gitorious_dev.* TO 'git'@'localhost';
    mysql> FLUSH privileges;
    mysql> exit;
  3. enable MySQL:
    # chkconfig mysqld on

gitorious

  1. on ein, clone the git repo:
    git clone git://gitorious.org/gitorious/mainline.git gitorious
  2. back on brainiac, clone the git repo as the git user:
    $ git clone /src/files/git/gitorious gitorious
  3. edit a few things:
    $ cd gitorious
    $ mkdir tmp/pids
    $ exit
    # ln -s /home/git/gitorious/script/gitorious /usr/local/bin/gitorious
    # cd /home/git/gitorious
    # chmod ug+x script/*
    # chmod -R g+w config/ log/ public/ tmp/
  4. su - git edit files (RUBY_HOME=”/usr/lib/ruby”)
    • settings:
      • RUBY_HOME=”/usr/lib/ruby”
      • GEMS_HOME=”/usr/lib/ruby/gems/1.8/gems/stompserver-0.9.9”
      • GITORIOUS_HOME=”/home/git/gitorious”
    • files:
      • gitorious/doc/templates/centos/stomp
      • gitorious/doc/templates/centos/git-ultrasphinx
      • gitorious/doc/templates/centos/git-poller
        • also, export _JAVA_OPTIONS=-Xmx64m
      • gitorious/doc/templates/centos/git-daemon
    • other files (not with above settings):
      • gitorious/config/gitorious.yml (gitorious.sample.yml)
      • database.sample.yml
      • broker.yml.example
  5. now install some bundles as root:
    # gem install bundle
    # cd /home/git/gitorious
    # bundle install
    # bundle exec rake gems:install
    or if that fails,
    # bundle exec rake gems:install RAILS_ENV=production
    # gem install stompserver (it wasn't installed with the bundle)
  6. install/start the daemons:
    chmod 0666 /home/git/gitorious/log/production.log
    
    ln -s /home/git/gitorious/doc/templates/centos/git-daemon /etc/init.d/git-daemon
    chkconfig --add git-daemon
    service git-daemon start
    ** see note/fix below
    
    ln -s /home/git/gitorious/doc/templates/centos/stomp /etc/init.d/stomp
    chkconfig --add stomp
    service stomp start
    ** need to add: /home/git/gitorious/tmp/stomp/log/
    ** need to run: gem install stompserver
    
    ln -s /home/git/gitorious/doc/templates/centos/git-poller /etc/init.d/git-poller
    chkconfig --add git-poller
    service git-poller start
    • fix for problem starting git-daemon, needed on centos6:
      1. run:
        # git clone git://github.com/roman/rots.git
      2. run:
        # cd rots && gem build rots.gemspec && gem install rots-0.2.1.gem
      3. run:
        rm -rf /usr/lib/ruby/gems/1.8/bundler/gems/rots-babb5559aae8
      4. edit /var/www/gitorious/Gemfile:
        # replace:
        gem ''"rots", :git => 'https://github.com/roman/rots.git' ''
        # with
        gem ''"rots", "~> 0.2.1"''
      5. run:
        # bundle install && bundle pack
      6. run:
        # export RAILS_ENV=production && \
        bundle exec rake db:create && \
        bundle exec rake db:migrate && \
        bundle exec rake ultrasphinx:bootstrap

Apache

  1. edit xsendfile.conf:
    # vim /etc/httpd/conf.d/xsendfile.conf
    #add below LoadModule line
    XSendFile on
    XSendFilePath /home/git/data/tarballs
    XSendFilePath /home/git/data/repos
  2. gem install passenger
  3. passenger-install-apache2-module
       LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
       PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
       PassengerRuby /usr/bin/ruby
    
       <VirtualHost *:80>
          ServerName www.yourhost.com
          DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
          <Directory /somewhere/public>
             AllowOverride all              # <-- relax Apache security settings
             Options -MultiViews            # <-- MultiViews must be turned off
          </Directory>
       </VirtualHost>
  4. configure apache (getting tired) - need to get configs
  5. start apache
  6. add git admin user:
    su git
    cd ~/gitorious
    env RAILS_ENV=production script/create_admin
     
    #sample
    Type in Administrator's e-mail:
    admin@matthouse.us
    Type in Administrator's password:
    <APASSWORD>
    Admin user created successfully.
     
    exit

Ultrasphinx

  1. run ultrasphinx bundles:
    # cd /home/git/gitorious
    # bundle exec rake ultrasphinx:configure RAILS_ENV=production
    # bundle exec rake ultrasphinx:index RAILS_ENV=production
    # bundle exec rake ultrasphinx:daemon:start RAILS_ENV=production
  2. install/configure aspell:
    # yum install aspell
    # aspell config dict-dir
    # cp vendor/plugins/ultrasphinx/examples/ap.multi /usr/lib64/aspell-0.60/
    # bundle exec rake ultrasphinx:spelling:build
      - edit ultrasphinx config ''/home/git/gitorious/config/ultrasphinx/production.conf'': <code> 
    #change "address" to "listen" due to deprecation
      listen = 0.0.0.0
  3. setup init scripts and start service:
    # ln -s /home/git/gitorious/doc/templates/centos/git-ultrasphinx /etc/init.d/git-ultrasphinx
    # chkconfig --add git-ultrasphinx
    # service git-ultrasphinx start

You may have to manually kill ultrasphinx (try to stop it with the init script, if you can't, kill it) - then you can use the init script

final notes

  1. need? maybe… ln -s /usr/local/bin/gitorious /usr/bin
  2. if clone/push urls don't display:
    # cd /var/www/gitorious
    # git submodule init
    # git submodule update
    # cd public/javascripts
    # rm all.js (it's probably empty)

Notes

yum install git-core git-svn java-1.6.0-openjdk vim-* apg pcre pcre-devel zlib zlib-devel libyaml-devel GeoIP-devel sphinx mysql-devel mysql-server mysql

No package apg available.
Package pcre-7.8-3.1.el6.x86_64 already installed and latest version
Package zlib-1.2.3-27.el6.x86_64 already installed and latest version
No package libyaml-devel available.
No package GeoIP-devel available.
No package sphinx available.
using config file '/home/git/gitorious/config/ultrasphinx/production.conf'...
WARNING: key 'address' is deprecated in /home/git/gitorious/config/ultrasphinx/production.conf line 10; use 'listen' instead.

not needed

  • install ruby enterprise:
    # wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz
    # tar xzf blah
    # yum install gcc-c++ make zlib-devel openssl-devel readline-devel
    # cd ruby-en...
    # ./install (accept defaults)
linux/server/gitorious.txt · Last modified: 2012/01/19 22:42 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki