This guide will utilize the Gitorious Chef recipe script, compiled by makewhatis. However, you should take note of the following:

  • Install it on a clean and fresh CentOS 6 (32 or 64bit). If you have existing CentOS 6, I would suggest you virtualize another CentOS 6 just for Gitorious.
  • The script re-organizes the httpd.conf files since it's based on Ubuntu's chef recipe. Therefore, do not do this if you have any existing httpd.conf that contains all of your websites' configuration.
  • You will need a dedicated domain or sub-domain (localhost.tld or git.localhost.tld) only for Gitorious.
  • Backup your files first before proceeding! Otherwise, create a snapshot of your machine.

* Disclaimer: We will not be responsible if this guide deleted your files or crashed your machine. Installation of Gitorious based on this guide is at your own risk!

Preparation

Install EPEL repository if you do not have it yet:

wget http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-7.no…
rpm -Uvh epel-release-6*.rpm

Visit EPEL repository page for the latest build.

It is suggested that you temporary disable any other 3rd-party repository, especially RPMForge as it caused some issue with the Gitorious installation during my trial and error session.

On top of that, we would have to disable SELinux:

nano /etc/selinux/config

Change SELINUX=enforcing to SELINUX=disabled. Reboot your machine after you save the file.

Using the recipe

Run the following commands in your machine to download the script:

wget -O /root/chef-solo-prep.sh https://raw.github.com/gist/2d3e996ae10129596afa/68acab43c020627a996d87… 
bash /root/chef-solo-prep.sh

To have the latest gitorious-cent6-prep.sh script, head on to the GitHub page.

After installing, you will need to review the settings in /root/chef-solo/node.json by editing the file. The following settings that you should take note of:

"db": {
  "user": "[Your MySQL username]",
  "host": "localhost",
  "database": "[The name of the db that Gitorious will be installed in]",
  "password": "[The assigned password to the MySQL username]",
}

"admin": {
  "email": "[The admin email login]",
  "password": "[The admin password that will be used with the email login]",
}

"mysql": {
  "server_root_password": "[The assigned MySQL root password]",
}

 

Once you have reviewed the settings, save the file.

Then run: chef-solo

This will install Gitorious along with the dependent packages. Hence, it will take quite some time for the process to complete.

Once the installation is complete, do review your configuration file as well: nano /var/www/gitorious/config/gitorious.yml. The following settings that you should take note of:

gitorious_client_host: [The URL used for your Gitorious]

gitorious_host: [The URL used for your Gitorious]

Save the file once you have made the changes.

You may want to change the time zone as well for date/time accuracy: nano /var/www/gitorious/config/gitorious.yml.

config.time_zone = '[For example: Kuala Lumpur]'

Save the file and restart Apache.

You should be able to visit your Gitorious now by opening https://[The.URL.assigned] and sign in with the admin e-mail and password assigned in node.json file earlier. Phew, imagine the actual amount of work needed just to setup Gitorious.

Common issues

STDOUT: Stopping httpd: [ OK ] Starting httpd: [FAILED] STDERR: httpd: Could not open configuration file /etc/httpd/conf/httpd.conf: Permission denied

Disable SELINUX!

Published on 7 December 2012 - 6:57am