Static Hosting

From Dark Peak
Revision as of 09:54, 20 September 2018 by Mbooth (talk | contribs) (Custom domains: New server, new IP address...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Static web-hosting is made available to git repositories through the use of hooks. This allows you to push html/js/css to a Gitolite hosted repository and see the changes automatically appear on the web.

Enabling web hosting for a repository

First, clone your gitolite-admin and find the entry for the target repository inside the conf/gitolite.conf file. Then, update the repo with the following 'pages' hook.

repo mywebsite
  option = pages
  RW+ = username

Commit and push this change to the server and your 'pages' hook will be installed on the 'mywebsite' repository. On your next update to the 'mywebsite' repository, you'll be able to view the website at

Custom web root

You can host sub-directories as the root of your site by adding a config option to your conf/gitolite.conf. Eg, to serve your website from ./www, use the following:

repo mywebsite
  config = "www"
  option = pages
  RW+ = username

This will take effect the next time you push an update to the mywebsite repository. NOTE: deleting config options will NOT reset them, if you want to reset your pages root directory change the value from "www" to "." or "" (empty string).

Custom domains

To use your own domain name for the site, add a CNAME file containing the domain name to the root directory of the target repository. Only one custom domain can be setup per repository.

Example CNAME file:

You'll have to update your domain with your DNS provider to point to the Dark Peak servers. If you want to use a subdomain, eg, you can add a CNAME record for that subdomain to point to the Dark Peak servers ( If you'd like to use an apex domain, eg, then setup an A record for your domain which points to the Dark Peak servers (