Simple git web interface
Posted on Sat 07 January 2012 in Tech
I decided instead of springing for a monthly github payed account I'd install git on a server and use a decent web interface that could be easily installed.
So for this little guide I'm rocking ubuntu 10.04 with git and lighttpd already installed.
It was a Goldilocks search for ease of installation vs web interfaces usefulness. I tried a number of options, gitweb looked a little rough for my liking and Gitorious and InDeferno were just an utter pain to install. Eventually I came across gitalist and decided I would give it's incredibly simple to installation go(http://www.gitalist.com/install/). By simply following the directions I managed to get it running without any thought. The problem was it was running on port 3000, I wanted it to hook it into lighttpd and have it run under a subdomain.
Since Gitalist is built with the catalyst framework, I figured using a lighttpd catalyst tutorial would do the job.
Firstly you need to install FCGI and FCGI Process Manager for perl, so
sudo cpan FCGI FCGI::ProcManager
Or on ubuntu I think you can use
sudo apt-get install libfcgi-perl libfcgi-procmanager-perl
Now attempt to execute this command
/var/www/gitalist/script/gitalist_fastcgi.pl —listen 127.0.0.1:55900 —nproc 5
If your ubuntu install is anything like mine a bunch of errors with get thrown in relation is FCGI.pm(And the proc manager) not being found. If you do, run a locate for FCGI.pm, find which folder it's under then make sure the folder FCGI.pm is in is in perl's @INC variable(this list of folders should have been printed out when the above command executed and failed). Then add them to the @INC in gitalist.
So for me, I simply edited lib/Gitalist/Script/FastCGI.pm and added these 2 lines.
> push(@INC, "/usr/local/lib/perl/5.10.1/");
push(@INC, "/usr/local/share/perl/5.10.1/");
Once these were added executing the gitalist_fastcgi.pl worked fine. Next step was to hook everything into lighttpd.
> $HTTP["host"] =~ "(^|.)git_repos.example.com$" {
fastcgi.server = (
"" => (
the extension is empty because we want to match on any extension
"127.0.0.1" => (
"host" => "127.0.0.1",
"port" => 55900,
"check-local" => "disable"
)
)
),
make sure these folders exist
server.errorlog = "/var/log/lighttpd/gitalist/error.log"
accesslog.filename = "/var/log/lighttpd/gitalist/access.log"
}
Give lighttpd a restart and it should all hopefully work just fine.