CGIT inside ispconfig 3

I got many git resources on my server, there must be a way to push it into the world wide web. CGI.GIT is one of them. Let’s try it out here inside of ispconfig 3.

Through the previous installation I have a lot of development tools on board.

Missing only:
yum install openssl-devel asciidoc xmlto

cd /usr/local/src
tar xf cgi-1.0.tar.xz
cd cgi-1.0
make get-git
make CGIT_SCRIPT_PATH=/usr/share/cgit prefix=/usr install install-man
install -m 0755 -d /usr/share/man/man5
install -m 0644 cgitrc.5 /usr/share/man/man5
install -m 0755 -d /usr/share/cgit
install -m 0755 cgit /usr/share/cgit/cgit.cgi
install -m 0755 -d /usr/share/cgit
install -m 0644 cgit.css /usr/share/cgit/cgit.css
install -m 0644 cgit.png /usr/share/cgit/cgit.png
install -m 0644 favicon.ico /usr/share/cgit/favicon.ico
install -m 0644 robots.txt /usr/share/cgit/robots.txt
install -m 0755 -d /usr/lib/cgit/filters
cp -r filters/* /usr/lib/cgit/filters

Aha, this files are installed. With yum history I removed the installed developer parts..

Create the cache
install -vd “/var/cache/cgit”

For better syntax highlight:
yum install highlight

create a new web site in ispconfig and check only cgi & active.
Option -> Apache directives:

<Directory /var/www/MyGitWebSide/web>
DirectoryIndex disabled
DirectoryIndex cgit.cgi
Options +ExecCGI
AddHandler cgi-script .cgi

Back in the console

cd /var/www/MyGitWebSide/web
cp /usr/share/cgit/* .
mkdir css
mv cgit.css cgit.png css
rm index.html

Clean up permissions:
chown -R webXXX:clientXXXX *

Directory looks like
cgit.cgi css favicon.ico robots.txt stats

vi /etc/cgitrc
# cgit config
# if you don’t want that webcrawler (like google) index your site
robots=noindex, nofollow
#syntax highlight
## and included like this:
## include=/etc/cgitrepos
repo.desc=Test Git
# if had another module – it would be added like so
# repo.url=OSGi-module
# repo.path=/home/git/repositories/OSGi-module.git
# repo.desc=the OSGi-module repository

cp /usr/lib/cgit/filters/ /usr/lib/cgit/filters/

Enable version 3 and add “–inline-css” at the end.

vi /usr/lib/cgit/filters/

# for version 3.
# Version 2 can be found (for example) on EPEL 5, while version 3 can be
# found (for example) on EPEL 6.
# This is for version 2
#exec highlight –force -f -I -X -S “$EXTENSION” 2>/dev/null

# This is for version 3
exec highlight –force -f -I –inline-css -O xhtml -S “$EXTENSION” 2>/dev/null

Now I’m able to browse my git on web.

Leave a Reply

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