Good-bye GitHub Stars, Setting Up Private gitweb Hosting on Ubuntu

I have installed gitweb on my Ubuntu 14.04 server to self-host my projects. I am using nginx to run the CGI script.

To set this up yourself is a simple enough process. Follow DigitalOcean’s instructions for setting up a private git server and then install gitweb and nginx:

sudo apt-get install gitweb fcgiwrap nginx

Make sure /usr/share/gitweb/ is readable. I just went ahead and made it globally readable:

sudo chmod -R +r /usr/share/gitweb/

If you followed the instructions linked to above edit your /etc/gitweb.conf so $projectroot = "/home/git";

Edit your nginx config:

sudo vim /etc/nginx/sites-enabled/default

I will access gitweb via, you might want to change /git/ to something relevant to you:

server {
    listen 80 default_server;

    root /usr/share/nginx/html;
    index index.html index.htm;

    server_name localhost;
    location /git/static/ {
        alias /usr/share/gitweb/static/;
    location /git/ {
        alias /usr/share/gitweb/;
        fastcgi_param SCRIPT_FILENAME   /usr/share/gitweb/index.cgi;
        include fastcgi_params;
        gzip off;
        fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
        fastcgi_pass unix:/var/run/fcgiwrap.socket;

Be sure to set SCRIPT_FILENAME before the include statement.

Then start fcgiwrap and nginx:

sudo service fcgiwrap start
sudo service nginx start

If something doesn’t work check your access and error logs in /var/log/nginx/. You can stop your nginx server with service nginx stop and fcgiwrap with sudo service fcgiwrap start. You might also want to get an SSL cert and set up http auth. I also recommend installing highlight and turning on syntax highlighting for blob views in gitweb.

A comment on HN by GuiA regarding Terry Davis and his operating system inspired me to make this change.

I’m a huge fan of Terry’s work, because he works hard, has a clear vision for what he wants to do, and makes it happen. That’s more than can be said of many self-professed hackers who never see a project to completion or are motivated solely by peer recognition.

You may disagree with the logical coherency of his goals - I for one think the “temple for God” thing is pure kookery - but he is a master craftsman, and in this context it’s all that really matters.

In 2010 I gave up on Diomedes, an IRC client written in JavaScript on Adobe Air’s platform.


It was ugly, but it was mine and I had spent over a year on it. Few people use Adobe Air and none wanted Diomedes but I have regrets giving up. It was a fun project and it worked just the way I wanted. The code wasn’t special but it was easy to maintain and extend. It was compatible with different IRC server software, had support for Adobe Air’s automatic updating and I continuously improved the UI. Diomedes had its own IRC protocol parser and worked on both Windows and Mac OS X. I still remember Diomedes’ code, the problems I had and solved, the architecture, what abstractions it used and how different parts of the app communicated with each other. This is not true for my projects since then.

GitHub led me to value code’s social aspects. Popular projects created excitement and engineering credentials. Diomedes’ code was hosted privately on unfuddle, but near the end I moved it to GitHub. It never became popular. When my motivation turned to peer-recognition my projects became less fun, less useful, and considerably less likely to achieve completion.

This brings me back to GuiA’s comment about Terry. Similar to Terry, though on a less grand technical scale, when it came to Diomedes I worked hard, had a clear vision for what I wanted to do, and made it happen. I want a project that I own, that solves a problem I have without worrying about GitHub and stars.

Thus gitweb, which isn’t so hard to set up, and not such a terrible thing since I am not looking to get others involved in my work. The code can be viewed via a web browser and tools like SourceTree have wonderful UIs. For issue tracking I will start with a text file, as I did with Diomedes, and if I find the project getting bigger I might install Redmine. I passed on GitLab, the setup and resources required were much too involved.

My code wont be open source and it wont be social. It doesn’t need to be any of these things. I’ll have fun just the same.


Now read this

What you should know about JavaScript regular expressions

Regular expressions in JavaScript may not always be intuitive. I aim to provide some clarity by providing examples about things I have found myself getting stuck on. This post covers a few topics including state in regular expressions,... Continue →

Subscribe to Bjorn Tipling

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.