Ridiculously long set of instructions on how to get Gitorious running on CentOS 5.6 64-bit. The vast majority of these instructions are copied from http://famousphil.com/blog/2011/06/installing-gitorious-on-centos-5-6-x64/

Before applying these instructions, do yourself a favor and search and replace for the following:

<hostname.domain>

<mysqladminpassword>

<admin email>

<gitmysqlpassword>

<country>

<state>

<city>

<company>

<gitoriousadminpassword>

########################################
# Centos 5.6 64-bit - install for gitorious
# Using VMware Fusion: 2CPU, 2GB RAM, 20GB HD
# Install from 5.6 x86_64 DVD, and generally accept all defaults
########################################
# set hostname manually
<hostname.domain>

# uncheck "Desktop - Gnome"
# customize now
Development...
	Development Libraries
	Development Tools
	Java Development
	Ruby
Servers...
	MySQL Database
Base System
	Uncheck Dialup Networking Support
	Java

# reboot as install completes
# ignore configuration app
# login as root
yum -y update

# snapshot VM

########################################
# gitorious install
# Shamelessly cribbed from:
#	http://famousphil.com/blog/2011/06/installing-gitorious-on-centos-5-6-x64/
########################################
####################
# setup rpmforge
####################
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

####################
# install required packages
####################
yum install -y 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

####################
# secure mysql
####################
service mysqld start
/usr/bin/mysql_secure_installation
	Enter current password for root (enter for none): <enter>
	Set root password? [Y/n] Y
	New password: <mysqladminpassword>
	Re-enter new password: <mysqladminpassword>
	Remove anonymous users? [Y/n] y
	Disallow root login remotely? [Y/n] y
	Remove test database and access to it? [Y/n] y
	Reload privilege tables now? [Y/n] y

####################
# get latest stable ruby enterprise (the rubylang 1.9 branch will not work properly)
####################
# http://www.rubyenterpriseedition.com/download.html
wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz
tar xzf ruby-enterprise-1.8.7-2011.03.tar.gz
cd ruby-enterprise-1.8.7-2011.03
./installer
# (accept the defaults, 2 prompts will come up)

# create symlink
cd /opt
ln -s ruby-enterprise-1.8.7-2011.03 ruby

####################
# edit system files
####################
vim /etc/profile
 	# add the following to /etc/profile in the 'if [ "$EUID" = "0" ]' section
	pathmunge /opt/ruby/bin
	export RAILS_ENV=production
	export PATH=/usr/local/sphinx/bin:/usr/local/bin:$PATH
	export MAGICK_HOME=/usr/local
	export DYLD_LIBRARY_PATH=/usr/local/lib

vim /etc/bashrc
	# add to the very bottom
	pathmungea ()
	{
		if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
			if [ "$2" = "after" ] ; then
				PATH=$PATH:$1
			else
				PATH=$1:$PATH
			fi
		fi
	}
	pathmungea /opt/ruby/bin
	export RAILS_ENV=production
	export PATH=/usr/local/sphinx/bin:/usr/local/bin:$PATH
	export MAGICK_HOME=/usr/local
	export DYLD_LIBRARY_PATH=/usr/local/lib
	unset pathmungea

# logout, login as root to get new settings

####################
# ImageMagick install
####################
yum -y install ImageMagick
yum install -y tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel

# ImageMagick on yum is outdated, so a bug will show up if we don’t do this for now.
cd ~
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.7.0*.tar.gz
tar xzf ImageMagick-6.7.0*.tar.gz
cd ImageMagick-6.7.0*
./configure --prefix=/usr/local --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes
make; make install

####################
# install various gems
####################
gem install sphinx rmagick ultrasphinx mime-types chronic ruby-hmac daemons mime-types BlueCloth ruby-yadis ruby-openid rspec rspec-rails RedCloth stompserver --no-ri --no-rdoc

####################
# install some repositories
####################
cd ~
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

####################
# create git user and get gitorious code
####################
useradd -d /home/git git

su git
	cd ~
	mkdir log
	mkdir conf
	git clone git://gitorious.org/gitorious/mainline.git gitorious
	cd gitorious/
	mkdir -p tmp/pids
	exit
	# (exit here will return to root)

####################
# fix up file system and modify gitorious templates
####################
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/

su git
	vim /home/git/gitorious/doc/templates/centos/git-daemon
		RUBY_HOME="/opt/ruby"
		GITORIOUS_HOME="/home/git/gitorious"
	vim /home/git/gitorious/doc/templates/centos/git-ultrasphinx
		GITORIOUS_HOME="/home/git/gitorious"
	vim /home/git/gitorious/doc/templates/centos/git-poller
		RUBY_HOME="/opt/ruby"
		GITORIOUS_HOME="/home/git/gitorious"
	vim /home/git/gitorious/doc/templates/centos/stomp
		RUBY_HOME="/opt/ruby"
		GEMS_HOME="/opt/ruby"
		GITORIOUS_HOME="/home/git/gitorious"
	exit  # return to root

####################
# copy sample .yml
####################
cd /home/git/gitorious
cp config/database.sample.yml config/database.yml
cp config/gitorious.sample.yml config/gitorious.yml
cp config/broker.yml.example config/broker.yml

# install bundle
bundle install

# fix up filesystem
su git
	mkdir /home/git/data
	mkdir /home/git/data/repositories
	mkdir /home/git/data/tarballs
	mkdir /home/git/data/tarball-work
	chown -R git:git /home/git/data
	# enable key management
	mkdir /home/git/.ssh
	chmod -R 700 /home/git/.ssh
	touch /home/git/.ssh/authorized_keys
	chmod 600 /home/git/.ssh/authorized_keys
	chmod -R 700 /home/git/data
	exit # back to root

# permissions fix:
chown -R git:git /home/git
chmod 711 /home/git

# generate cookie_secret (for use in gitorious.yml)
# you should use what *you* generate, not what's listed here
apg -m 64

hylmIrgInonsOlAvoarfortisFagNevDawkejIndyopMaxegpistAtWepkidkib8yugfackicShakfenkoskOoddaymrityasUtvecapJuejwoolfyijnecCiafilpemnijKaheavHiskyavGiwyghejCaitkopFovlekdaksyeyftAckinPabyurEztisOdreckViHiffeddIrtyffUrbUjirlyis2OkozDoshObUtyefEbnafmicoitOftEtKuyebTidVoHimgovGeapCyeluvarvAwIjRajRoamDofaughCidujoynmendUcgevevocciHosoichvarm)SliagishpenveafQuecJiatmalsyimyizAicMirAwtanpow7

####################
# edit yml files
#################### 

vim /home/git/gitorious/config/gitorious.yml
##########
development:
  cookie_secret: hylmIrgInonsOlAvoarfortisFagNevDawkejIndyopMaxegpistAtWepkidkib8yugfackicShakfenkoskOoddaymrityasUtvecapJuejwoolfyijnecCiafilpemnijKaheavHiskyavGiwyghejCaitkopFovlekdaksyeyftAckinPabyurEztisOdreckViHiffeddIrtyffUrbUjirlyis2OkozDoshObUtyefEbnafmicoitOftEtKuyebTidVoHimgovGeapCyeluvarvAwIjRajRoamDofaughCidujoynmendUcgevevocciHosoichvarm)SliagishpenveafQuecJiatmalsyimyizAicMirAwtanpow7
  repository_base_path: "/home/git/data/repositories"
  extra_html_head_data:
  system_message:
  gitorious_client_port: 80
  gitorious_client_host: <hostname.domain>
  gitorious_host: <hostname.domain>
  gitorious_user: git
  exception_notification_emails: <admin email>
  mangle_email_addresses: true
  public_mode: true
  locale: en
  archive_cache_dir: "/home/git/data/tarballs"
  archive_work_dir: "/home/git/data/tarball-work"
  only_site_admins_can_create_projects: true
  hide_http_clone_urls: false
  is_gitorious_dot_org: false
  use_ssl: false

test:
  cookie_secret: hylmIrgInonsOlAvoarfortisFagNevDawkejIndyopMaxegpistAtWepkidkib8yugfackicShakfenkoskOoddaymrityasUtvecapJuejwoolfyijnecCiafilpemnijKaheavHiskyavGiwyghejCaitkopFovlekdaksyeyftAckinPabyurEztisOdreckViHiffeddIrtyffUrbUjirlyis2OkozDoshObUtyefEbnafmicoitOftEtKuyebTidVoHimgovGeapCyeluvarvAwIjRajRoamDofaughCidujoynmendUcgevevocciHosoichvarm)SliagishpenveafQuecJiatmalsyimyizAicMirAwtanpow7
  repository_base_path: "/home/git/data/repositories"
  extra_html_head_data:
  system_message:
  gitorious_client_port: 80
  gitorious_client_host: <hostname.domain>
  gitorious_host: <hostname.domain>
  gitorious_user: git
  exception_notification_emails: <admin email>
  mangle_email_addresses: true
  public_mode: true
  locale: en
  archive_cache_dir: "/home/git/data/tarballs"
  archive_work_dir: "/home/git/data/tarball-work"
  only_site_admins_can_create_projects: true
  hide_http_clone_urls: false
  is_gitorious_dot_org: false
  use_ssl: false

production:
  cookie_secret: hylmIrgInonsOlAvoarfortisFagNevDawkejIndyopMaxegpistAtWepkidkib8yugfackicShakfenkoskOoddaymrityasUtvecapJuejwoolfyijnecCiafilpemnijKaheavHiskyavGiwyghejCaitkopFovlekdaksyeyftAckinPabyurEztisOdreckViHiffeddIrtyffUrbUjirlyis2OkozDoshObUtyefEbnafmicoitOftEtKuyebTidVoHimgovGeapCyeluvarvAwIjRajRoamDofaughCidujoynmendUcgevevocciHosoichvarm)SliagishpenveafQuecJiatmalsyimyizAicMirAwtanpow7
  repository_base_path: "/home/git/data/repositories"
  extra_html_head_data:
  system_message:
  gitorious_client_port: 80
  gitorious_client_host: <hostname.domain>
  gitorious_host: <hostname.domain>
  gitorious_user: git
  exception_notification_emails: <admin email>
  mangle_email_addresses: true
  public_mode: true
  locale: en
  archive_cache_dir: "/home/git/data/tarballs"
  archive_work_dir: "/home/git/data/tarball-work"
  only_site_admins_can_create_projects: true
  hide_http_clone_urls: false
  is_gitorious_dot_org: false
  use_ssl: false
##########

vim /home/git/gitorious/config/broker.yml
##########
production:
    adapter: stomp
development:
    adapter: stomp
test:
    adapter: stomp
##########

vim /home/git/gitorious/config/database.yml
##########
development:
  adapter: mysql
  database: gitorious_dev
  username: git
  password: <gitmysqlpassword>
  host: localhost
  encoding: utf8

test:
  adapter: mysql
  database: gitorious_test
  username: git
  password: <gitmysqlpassword>
  host: localhost
  encoding: utf8

production:
  adapter: mysql
  database: gitorious
  username: git
  password: <gitmysqlpassword>
  host: localhost
  encoding: utf8
##########

####################
# initialize mysql
####################
mysql -uroot -p'<mysqladminpassword>'
	create database gitorious;
	create database gitorious_test;
	create database gitorious_dev;
	CREATE user 'git'@'localhost' IDENTIFIED BY '<gitmysqlpassword>';
	GRANT ALL ON gitorious.* TO 'git'@'localhost';
	GRANT ALL ON gitorious_test.* TO 'git'@'localhost';
	GRANT ALL ON gitorious_dev.* TO 'git'@'localhost';
	FLUSH privileges;
	exit;

####################
# fix permissions
####################
chown -R git:git /home/git
chmod -R 755 /home/git/data
chmod 755 /home/git/gitorious

####################
# run bundle commands
####################
cd /home/git/gitorious
bundle exec rake db:create:all
bundle exec rake db:setup
bundle exec rake db:migrate
bundle exec rake gems:install

####################
# fix permissions
####################
chown -R git:git /home/git
chmod -R 755 /home/git/data
chmod 755 /home/git/gitorious

####################
# set up daemons
####################
# gem uninstall daemons 1.1.x version (you'll see specific version in an error after 'service git-daemon start')
gem uninstall daemons -v 1.1.4

ln -s /home/git/gitorious/doc/templates/centos/git-daemon /etc/init.d/git-daemon
chmod +x /etc/init.d/git-daemon
chkconfig --add git-daemon
service git-daemon start

ln -s /home/git/gitorious/doc/templates/centos/stomp /etc/init.d/stomp
chmod +x /etc/init.d/stomp
chkconfig --add stomp
service stomp start

ln -s /home/git/gitorious/doc/templates/centos/git-poller /etc/init.d/git-poller
chmod +x /etc/init.d/git-poller
chkconfig --add git-poller
service git-poller start

####################
# install webserver
####################
yum install -y httpd httpd-devel mod_xsendfile

# configure xsendfile
vim /etc/httpd/conf.d/xsendfile.conf
	# add below LoadModule line
	XSendFile on
	XSendFilePath /home/git/data/tarballs
	XSendFilePath /home/git/data/repositories

# install ruby Passenger to make Ruby applications work on Apache.
/opt/ruby-enterprise-1.8.7-2011.03/bin/passenger-install-apache2-module
# accept the defaults

vim /etc/httpd/conf/httpd.conf
##########
## Section 1: Global Environment
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
Listen 80

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule asis_module modules/mod_asis.so

LoadModule unique_id_module modules/mod_unique_id.so

LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
   PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.7
   PassengerRuby /opt/ruby/bin/ruby

Include conf.d/*.conf
#ExtendedStatus On
User apache
Group apache

## Section 2: 'Main' server configuration

ServerAdmin <admin email>
ServerName <hostname.domain>:80
UseCanonicalName Off
DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

DirectoryIndex index.html index.html.var index.htm
AccessFileName .htaccess

<Files ~ "^\.ht"> #deny serving ht files
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
#   MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off
#EnableMMAP off
#EnableSendfile off
ErrorLog logs/error_log
LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

#CustomLog logs/access_log common
#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent
CustomLog logs/access_log combined

ServerSignature On

Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

#
# WebDAV module configuration section.
#
<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
    AllowOverride All
    Options None
    Order allow,deny
    Allow from all
</Directory>

# Redirect permanent /foo http://www.example.com/bar

# Directives controlling the display of server-generated directory listings.
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
#AddType application/x-tar .tgz
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler cgi-script .cgi .pl
#AddHandler send-as-is asis
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

# 1) plain text 2) local redirects 3) external redirects
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>

#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#    ErrorDocument 410 /error/HTTP_GONE.html.var
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

</IfModule>
</IfModule>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

<IfModule prefork.c>
StartServers       1
MinSpareServers    1
MaxSpareServers  1
ServerLimit      128
MaxClients       128
MaxRequestsPerChild  1000
</IfModule>

## Section 3: CONF STUFF
Include conf/host.conf
##########

####################
# setup SSL
####################
cd ~
yum install -y mod_ssl openssl
openssl genrsa -out ca.key 2048
openssl req -new -key ca.key -out ca.csr
# Country Name (2 letter code) [GB]:<country>
# State or Province Name (full name) [Berkshire]:<state>
# Locality Name (eg, city) [Newbury]:<city>
# Organization Name (eg, company) [My Company Ltd]:<company>
# Organizational Unit Name (eg, section) []:
# Common Name (eg, your name or your server's hostname) []:<hostname.domain>
# Email Address []:<admin email>
# A challenge password []:
# An optional company name []:

openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr
mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.disabled

vim /etc/httpd/conf/host.conf
##########
# enable ~user home directories.
<Directory /home/*/public_html>
    Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName  <hostname.domain>
        ServerAdmin <admin email>
        DocumentRoot /home/git/gitorious/public
        ErrorLog  /var/www/errorgit.log
        CustomLog /var/www/accessgit.log combined
        <Directory /home/git/gitorious/public>
          AllowOverride all
          Options -MultiViews
        </Directory>
</VirtualHost>

LoadModule ssl_module modules/mod_ssl.so
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

NameVirtualHost *:443

<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/ca.crt
        SSLCertificateKeyFile /etc/pki/tls/private/ca.key
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
        ServerName  <hostname.domain>
        ServerAdmin <admin email>
        DocumentRoot /home/git/gitorious/public
        ErrorLog  /var/www/errorgit.log
        CustomLog /var/www/accessgit.log combined
        <Directory /home/git/gitorious/public>
          AllowOverride all
          Options -MultiViews
        </Directory>
</VirtualHost>
##########

# test config
service httpd configtest

# disable SELinux
vi /etc/selinux/config
	SELINUX=disabled
echo 0 >/selinux/enforce

# start server
service httpd start

####################
# fix permissions again
####################
chmod 711 /home/git
chown -R git:git /home/git

####################
# create gitorious admin
####################
su git
	cd ~/gitorious
	env RAILS_ENV=production script/create_admin
		Type in Administrator's e-mail:
			<admin email>
	Type in Administrator's password:
			<gitoriousadminpassword>
	Admin user created successfully.
 	exit
	# exit back to root

####################
# ultrasphinx
####################
cd /home/git/gitorious
export RAILS_ENV=production
export PATH=/usr/local/sphinx/bin:$PATH

bundle exec rake ultrasphinx:configure RAILS_ENV=production

# due to some deprecation in code, the following two changes need to happen:
vim /home/git/gitorious/config/ultrasphinx/production.conf
	# replace "base_tags" with "tags" if necessary
	# change "address" to "listen" due to deprecation
	listen = 0.0.0.0

bundle exec rake ultrasphinx:index RAILS_ENV=production
bundle exec rake ultrasphinx:daemon:start RAILS_ENV=production

# the following command builds the sphinx dictionary.  For me it seg faults, but gets rid of a pesky dictionary error.
cd /home/git/gitorious
aspell config dict-dir
	# should show: /usr/lib64/aspell-0.60
cp vendor/plugins/ultrasphinx/examples/ap.multi /usr/lib64/aspell-0.60/
# the next command segfaults, but it makes an annoying error go away in a log
bundle exec rake ultrasphinx:spelling:build

# Finally, we need to make git-ultrasphinx a daemon.
ln -s /home/git/gitorious/doc/templates/centos/git-ultrasphinx /etc/init.d/git-ultrasphinx
chmod +x /etc/init.d/git-ultrasphinx

####################
# start services automatically
####################
chkconfig mysqld on
chkconfig httpd on

# a few bug fixes
ln -s /usr/local/bin/gitorious /usr/bin

####################
# fix permissions again
####################
chown -R git:git /home/git
chmod -R 755 /home/git/data
chmod 755 /home/git/gitorious

####################
# install memcached
####################
yum install -y --enablerepo=remi memcached
service memcached start
chkconfig memcached on

####################
# create script to startup services on boot
####################
vim /root/startup.sh
	#!/bin/sh
	/etc/init.d/stomp start				# seemed to start
	/etc/init.d/git-daemon start 		# didn't seem to start
	/etc/init.d/git-poller start		# didn't seem to start
	/etc/init.d/git-ultrasphinx start	# doesn't seem to work - had to "bundle exec rake ultrasphinx:daemon:start RAILS_ENV=production"

crontab -e
	# add the following to root’s crontab
	MAILTO=""
	@reboot /root/startup.sh

su git
	crontab -e
		# add the following to git’s cron, which indexes the site every hour
		MAILTO=""
		* */1 * * * cd /home/git/gitorious && /opt/ruby/bin/rake ultrasphinx:index RAILS_ENV=production
	exit
	# exit to root

####################
# kill iptables
####################
chkconfig iptables off

reboot

####################
# setup mail
####################
vim /etc/mail/local-host-names
	# add local hosts as appropriate
	localhost
	<hostname.domain>

vim /root/.forward
	#add your email address to the first line
	<admin email>

service sendmail restart

####################
# run tests if you care
####################
cd /home/git/gitorious
bundle exec rake test

####################
# on local box
####################
# edit local /etc/hosts to force domain name
https://<hostname.domain>/

15 Thoughts on “Gitorious and CentOS 5.6 64-bit

  1. tam on 7/12/2011 at 10:55 pm said:

    I found error when I go to this step

    ln -s /home/git/gitorious/doc/templates/centos/git-daemon /etc/init.d/git-daemon
    chmod +x /etc/init.d/git-daemon
    chkconfig –add git-daemon
    service git-daemon start

    [root@cengito gitorious]# service git-daemon start
    Starting git-daemon: /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require’: no such file to load — daemons (LoadError)
    from /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require’
    from /home/git/gitorious/script/git-daemon:4
    [FAILED]

    Can you help me?

  2. Not quite sure what’s missing from /home/git/gitorious/script/git-daemon line #4 – it might be that there was an update to gitorious since I did these install instructions…maybe check the git you cloned, and see if moving back in time helps?

    UPDATE: Checked the git history, didn’t see any changes that would’ve done anything after I made this post.

    Upon closer inspection, it looks like git-daemon line #4 has “require geoip”. I’d try making sure that requirement is fulfilled. The only reference I see to it in my walkthrough is this yum command:

    yum install -y 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

  3. tam on 7/13/2011 at 2:13 am said:

    Thank you for help Jere

    I alreay to try

    yum install -y 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

    I foudn GeoIp-devel install again and for libyaml-devel I found this

    Transaction Check Error:
    package libyaml-0.1.3-1.el5.rf.x86_64 (which is newer than libyaml-0.1.2-3.el5.i386) is already installed
    package libyaml-devel-0.1.3-1.el5.rf.x86_64 (which is newer than libyaml-devel-0.1.2-3.el5.i386) is already installed

    I not sure this relate with my error.

    I will try all step again after update centos and will let you know again.

  4. tam on 7/13/2011 at 4:49 pm said:

    Jere, Now I finished to install Gitorious on my VM I think last error come from some library is missing to install becase I found downtime of gistorios and fedora host

    Thank for grate instruction! :)

  5. My pleasure tam, glad it worked out!

  6. marc on 2/1/2012 at 3:49 pm said:

    First just comment that who ever has done the tutorial did a very good job.
    Second, I would like to add some information about some problems that came across during the installation/set up process and how I solve them.

    – All the installation process has been done under CentOS 6 x86_64 – so some points are specific for this OS/architecture !!

    * Installation el6 rpmforge packages instead of using the “el5” ones described in the guide. Steps:

    1. Download the rpmforge-release package. Choose one of the two links below, selecting to match your host’s architecture. If you are unsure of which one to use you can check your architecture with the command uname -i

    – i686: > wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
    – x86_64: > wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

    2. Install DAG’s GPG key

    > rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt

    3. If you get an error message like the following the key has already been imported:

    error: http://apt.sw.be/RPM-GPG-KEY.dag.txt: key 1 import failed.

    4. Verify the package you have downloaded

    > rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm

    5. Install the package

    > rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm

    * Download ImageMagick manually because the wget link was broken. Link: https://launchpad.net/imagemagick/main/6.7.0-2

    * Install extra libraries if Nokogiri gem installation fails:

    > sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel

    * > bundle exec rake gems:install -> No such file or directory – /home/git/gitorious/config/gitorious.yml

    > cd /home/git/gitorious/config
    > cp gitorious.sample.yml gitorious.yml

    * Problems running “bundle exec rake gems:install” command:

    a) If Password = No error -> config/database.yml // set password with the one created for Mysql
    b) Create Gitorious DB:

    > mysql -uroot –p’’
    > create database gitorious;
    create database gitorious_test;
    create database gitorious_dev;
    CREATE user ‘git’@’localhost’ IDENTIFIED BY ”;
    GRANT ALL ON gitorious.* TO ‘git’@’localhost’;
    GRANT ALL ON gitorious_test.* TO ‘git’@’localhost’;
    GRANT ALL ON gitorious_dev.* TO ‘git’@’localhost’;
    FLUSH privileges;
    > exit;

    * Starting stompserver:Failure

    > gem install stompserver (from /home/git/gitorious dir)

    * Problems starting httpd service. Modify the apache config file (httpd.conf):

    > Comment the LoadModule’s that gives error
    > Search for the “mod_passenger.so” library and change the path of it to the right one in the
    a) LoadModule passenger_module
    b) PassengerRoot

    * Install aspell-0.60 if is missing:

    > yum install aspell

  7. Raj on 7/30/2013 at 1:21 pm said:

    I followed the entire process and started gitorious. But i am unable to see gitorious page from a browser. What is wrong ?

  8. @Raj – can you check your webserver logs to see if there are any errors?

  9. Raj on 7/30/2013 at 1:42 pm said:

    stompserver (pid 14730) is running…
    ./git-poller status
    ruby (pid 14798) is running…
    ./git-daemon status
    ruby (pid 27930) is running…
    service httpd status
    httpd (pid 27116) is running…

  10. @Raj – I’m talking about your httpd process logs (see /etc/httpd/conf/host.conf)

    Specifically:

    ErrorLog /var/www/errorgit.log
    CustomLog /var/www/accessgit.log combined

    Anything interesting in those two log files when you try to go to your webserver?

    Any interesting results when you use “curl” to try to go to your webserver? (curl https:///)

  11. Raj on 7/30/2013 at 2:17 pm said:

    No Sir, both errorgit.log and
    accessgit.log are of 0 size

    gitorious port 9418 is up, i restarted all daemons still no luck

  12. @Raj – Okay, so your pid (27116) is running, presumably off of /etc/httpd/conf/host.conf

    You have no logs in either error, or access.

    According to the conf, you should be listening on port 80 and port 443.

    So, a few double checks:

    netstat -an | grep 80
    netstat -an | grep 443

    That should validate that your httpd pid is actually listening on those ports.

    Then you should be able to telnet on port 80 or 443, to validate you can get to the port from wherever your browser is running.

    At this point, it looks like your browser isn’t traversing the network correctly to get to the server.

  13. Raj on 7/30/2013 at 3:04 pm said:

    netstat -an | grep 80
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
    tcp 0 0 127.0.0.1:8020 0.0.0.0:* LISTEN
    tcp 0 0 127.0.0.1:44122 127.0.0.1:8020 TIME_WAIT
    unix 2 [ ACC ] STREAM LISTENING 9580 private/discard
    [root@vc2c09mmk1264 log]# netstat -an | grep 443
    [root@vc2c09mmk1264 log]#

    when i try http:// i get Apache 2 Test Page. I was expecting Gitorious webpage

  14. Raj on 8/1/2013 at 7:55 am said:

    Hello

    Should port 443 be up for gitorious ?

  15. @Raj – If you followed the instructions for what to put into /etc/httpd/conf/host.conf, it should certainly be listening on port 443.

    Check your configs and make sure you’ve actually configured your httpd instance correctly.

    Did you actually follow all the instructions line by line? Were there any errors in earlier steps?

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Post Navigation