Insanely Awesome Web Interface for Your Git Repos

Almost 80-90 people visit How To: Install and Configure GitWeb everyday in search of setting up a web interface for their git repositories. Though gitweb is nice, it’s a bit painful to setup and the web interface is not that appealing. The other day I received this email from Klaus Silveira

Hello Kulbir,
I saw your article about installing Gitweb and i decided to send this shameless self-promotion. Maybe you could try my open-source project, GitList https://github.com/klaussilveira/gitlist

I’m looking for beta testers and supporters. FLOSS. 🙂

So, I thought I’ll just give it a try. Today, I got it working and was blown away by the amazing interface! It’s almost like a super simplified version of GitHub. I was so impressed that I immediately setup a demo website at git.gofedora.com for others to look at and fall in love :-)Another good thing about GitList is that it’s very simple to setup. Below is a step by step process to install and configure GitList to expose your public Git repositories to the internet.

What You Need?

You need the following packages before you can setup GitList.

Installing Required Packages

Most modern operating systems have the above mentioned packages installed by default. Even if you don’t have them already, you can use your OS package manager to install them quickly. To install on Fedora/RedHat/CentOS using yum, use the following command

[root@whitemagnet.com ~]$ yum install php git httpd

For Ubuntu/Debian, use the following command

[root@whitemagnet.com ~]$ apt-get install php git apache2

Assumptions

For setting up GitList, I am assuming the following directory paths and other variables.

  • Path to public Git repositories : /home/saini/code/public/
  • Path to Apache document root : /var/www/html/
  • Path to Git executable : /usr/bin/git (Use “which git” to find out for your OS)
  • Web URL for browsing git repos : mygit.example.com/gitlist/

Installing and Configuring GitList

Follow the following simple steps to install and configure GitList.

Step 1 : Clone GitList repository from GitHub to /var/www/html/gitlist/

[root@whitemagnet.com ~]$ cd /var/www/html/
[root@whitemagnet.com html]$ git clone git://github.com/klaussilveira/gitlist.git gitlist

Step 2 : Create cache directory and make it globally writable

[root@whitemagnet.com ~]$ cd gitlist
[root@whitemagnet.com gitlist]$ mkdir cache
[root@whitemagnet.com gitlist]$ chmod 777 cache

Step 3 : Configure GitList using config.ini

Open the config.ini (in gitlist directory) and set the option properly. Refer the sample shown below.

[git]
client = '/usr/bin/git' ; Your git executable path
repositories = '/home/saini/code/public/' ; Path to your repositories (with ending slash)
 
[app]
baseurl = 'http://mygit.exmaple.com/gitlist' ; Base URL of the application (without ending slash)

Step 4 : Make sure your Apache can read your .htaccess file in gitlist directory

GitList utilizes Apache’s mod_rewrite module to  provide nice URLs. Make sure your Apache is configured to read .htaccess from the gitlist directory. Open your Apache config file (generally located at /etc/httpd/conf/httpd.conf or /etc/apache2/ports.conf) and look for the following

<Directory "/var/www/html">

In this segment, make sure you have AllowOverride All as below.

<Directory "/var/www/html">
# Other lines omitted
AllowOverride All
# Other lines omitted
</Directory>

Step 5 : Reload or restart Apache daemon if needed

[root@whitemagnet.com ~]$ apachctl -k restart (or apache2ctl -k restart for Ubuntu/Debian)

Step 6 : Get some sample repositories in your public repo directory

Get some sample repositories in your public repo directory from GitHub.

[root@whitemagnet.com ~]$ cd /home/saini/code/public/
[root@whitemagnet.com ~]$ git clone git://github.com/kulbirsaini/intelligentmirror.git
[root@whitemagnet.com ~]$ git clone git://github.com/kulbirsaini/Railscasts-Sync.git
[root@whitemagnet.com ~]$ git clone git://github.com/zilkey/active_hash.git

That’s all! Now, go to http://mygit.example.com/gitlist to discover your public git repos via a cool web interface! Leave a comment if you face any issues.

 

My New Book on Squid Proxy Server (A Beginner’s Guide)

I have not blogged since a long time mainly because I was a bit busy authoring a book Squid Proxy Server 3.1: Beginner’s Guide for Packt Publications. The book is an introductory guide to Squid (especially the new features in Squid-3 series) covering both the basic aspects as well as the in dept details for advanced users. The book focuses on learning by doing and provides example scenarios for the concepts discussed throughout the book. Access control configuration, reverse proxying, interception proxying, authentication and other features have been discussed in details with examples.

Checkout the links below:

 

News : Fedora 12 : Constantine Released [All you need to know]

Much awaited Fedora 12 : Constantine has been released and is available now! This post is more of a collection of things you need to know before you go all the way to download Fedora 12 and install or upgrade.

FAQs

Q. What is Fedora?
A. The Fedora Project page describes it in a short and nice way!

Q. I want to know everything about Fedora 12. Where do I find it?
A. You are probably asking for Fedora 12 Release Notes.

Q. Will it work on my machine?
A. What do you have? A server/desktop/laptop/netbook/xo/some-alien-hardware! It’ll work if your machine satisfies the hardware requirements.

Q. I have been using Fedora since long. What are the new features in Fedora 12?
A. Please browse Fedora 12 : Constantine Feature List page.

Q. Ok. I am convinced. From where can I download Fedora 12?
A. Nice! Please visit Download Page for download options. Checkout torrents or select mirror from Fedora mirrors.

Q. No. I don’t want that regular DVD. Do you have something different to offer?
A. Yup! Spins community is doing a wonderful job! Chose one from KDE, LXDE, XFCE, BrOffice, FEL, Games and Edu spins.

Q. I have downloaded the Fedora ISO. How do I install it?
A. There are different ways in which you can install Fedora on your system.

  1. If you don’t have CD/DVD drive, you can follow How To: Install Fedora without CD or DVD.
  2. You can install Fedora using a USB drive. Checkout LiveUSB creator.
  3. You can follow the traditional way. Install using CD/DVD.

Q. I already have Fedora installed on my system. Should I upgrade or re-install?
A. Browse Upgrading Your Current System page and find out yourself.

Q. I think I want to upgrade my Fedora 11 system to Fedora 12. How do I do it using Yum?
A. Learn how to do it from the Yum Guru himself Yum upgrading to fedora 12 from fedora 11 or browse this page on Fedora Docs.

Q. I have ATI graphics card. How do I install Catalyst Display Drivers?
A. Follow How To: Install ATI Catalyst (fglrx) Drivers.

Q. Hey, I am stuck! I need some help. Where should I ask?
A. There are different ways like Real Time Support via IRC, mailing lists, forums etc. in which you can get help on topics related to Fedora. Browse Get Help page to checkout different methods.

Q. I like this Fedora thing. Can I help?
A. There are several ways in which you can help Fedora Project. The simplest way is to help others! Other methods can be ‘Write Documentation’, ‘Design for Fedora’, ‘Spread the Word’ or ‘Write Code’ 🙂 Checkout Join Fedora page.

 

How To: Save yourself from stupid Tech Support Questions

Almost every other geek is pwned by his friends or people he/she knows by their stupid tech support questions. And sometime they drag you to the limits that you get frustrated enough to shoot yourself and bang your head onto your computer screen 😛 How on earth can someone be so stupid 😛 But luckily I found a Pidgin Plugin called STFW(Search The F**king Web). This is one really awesome plugin I have seen recently and I (and most other geeks) needed something like this for ages 🙂

What it does?

When somebody asks you a question, you can reply back with relevant keywords from the message you received prefixed with the command /stfw. The plugin will automatically convert the keywords to a URL understood by the site Let Me Google That For You (lmgtfy.com) and asker will get a URL like this http://lmgtfy.com/?q=what+is+http.

How to use?

The Download, installation and usage instruction can be seen on plugin page. So, when someone ask you “Wireless not working on my laptop”, just reply back with the following message

/stfw Wireless not working on my laptop

C’mon guys, ask me tech support questions 😛

 

How To: Install PHP 5.3 on CentOS 5.1 or RHEL 5.1

PHP 5.2 and PHP 5.3 has tons of functionalities which are not provided by PHP 5.1 and PHP 5.1 is the most recent version of PHP available in CentOS 5.1 and RHEL 5.1 via updates. Also, its difficult for people to upgrade OS(s) on production servers frequently and especially if the servers are running absolutely fine, it doesn’t really make sense to upgrade just for the heck of it. One more reason for no upgrades is the OS choices provided by many hosting companies. But a lot of CMS(s) and softwares are now recommending at least PHP 5.2 for an extended feature set.

I tried a lot of repos for CentOS including RPM Fusion, RPM Forge, EPEL etc., but none of them could provide even PHP 5.2. In some corner of my mind, I had a faint idea of Remi Collet publishing updates about Remi repository. Did a quick google search and found out that PHP 5.3 is actually available in the repository 😀

So, if you are really in need of PHP5.3 on your CentOS/RHEL 5.1 or lesser, head over to Repository Configuration Page and follow the instructions.

Note: The repository is not enabled on install (enabled=0). You need to enable it in /etc/yum.repos.d/remi.repo.

Once installed and enabled, you can update PHP, MySQL from remi repository using the following command

[root@fedora ~]$ yum update php php-* mysql-*

Warning: Drupal is still not totally compatible with PHP5.3 and if you run Drupal sites, be sure to investigate things before upgrading.