To install cgit on Dreamhost shared server:

$ git clone https://git.zx2c4.com/cgit $ cd cgit $ git submodule init $ git submodule update $ $EDITOR cgit.conf

Edit first two lines to match your Dreamhost setup:

homedir = /home/youruser/ CGIT_SCRIPT_PATH = $(homedir)/cgit.yourdomain.com CGIT_CONFIG = $(homedir)/.cgitrc CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) CACHE_ROOT = $(homedir)/var/cache/cgit prefix = $(homedir)/.local libdir = $(prefix)/lib filterdir = $(libdir)/cgit/filters docdir = $(prefix)/share/doc/cgit htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man

Save the file, then:

$ make NO_LUA=1 $ make install

Write config file:

$ $EDITOR $HOME/.cgitrc

Here's a bare minimum content (see cgitrc.5.txt for details):

```

Bare minimum -- define a repository.

repo.url=foo repo.path=/home/youruser/git/foo.git repo.desc=the master foo repository repo.owner=fooman@yourdomain.com repo.readme=info/web/about.html ```

If you're using subdomain or the root of your web (not a subdirectory), you may want to edit an .htaccess in your web root:

DirectoryIndex cgit.cgi RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /cgit.cgi/$1 [END,QSA] RewriteCond %{QUERY_STRING} service=git-receive-pack RewriteRule .* - [END,F]

Additional resources:

  • https://www.andrewmarchetta.com/computing/setting-up-cgit-on-apache/