Setting Up Cgit on Debian

In order to publish the source code for the personal finance scripts I’ve been working on, I needed to set up a git repository. I don’t want to use a proprietary service like Github to publish my libre software. So until the project is popular enough to justify inclusion into an umbrella project like GNU or Kolab, I figured I’d host it myself on my inexpensive Scaleway ARM server.

I like content addressable networks, and it would be really neat to host the git repository on something like IPFS. But my experience to date with IPFS is that it’s not production ready. So for now, cgit via HTTP seems to be the path of least resistance.

The process of setting up cgit on a Debian server wasn’t as well documented as I had hoped. So here is a brief, after-the-fact writeup to hopefully improve the available documentation. I wasn’t exact in recording my steps, so there may be typos or omissions. Please let me know if you find any and I’ll try to quickly fix them.

First, I installed Apache and cgit. (If both were equally easy to deploy, I might prefer nginx to Apache, but the cgit Debian package ships an Apache configuration file, making it the easier-to-deploy option.)

sudo apt-get install apache2 cgit

Next, I needed to enable CGI. This is an essential step that I didn’t see documented in many of the blog howtos that my searches found, but it was mentioned on the excellent Arch Wiki article.

cd /etc/apache2/mods-enabled
ln -s ../mods-available/cgi.load

The last essential configuration step was to enable the cgit configuration file.

cd /etc/apache2/conf-enabled
ln -s ../conf-available/cgit.conf

This is optional, but I edited the default configuration to use /git/ instead of /cgit/. Restarting Apache was necessary to have the configuration changes take effect.

service apache2 restart

Here is the result: I may try to set up DNS to point to that one day, but the static IP should suffice for now.


One thought on “Setting Up Cgit on Debian

  1. Pingback: finctrl Goes Live | Cov's Libre Life

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s