www/cgit/pkg/README (view raw)
1$OpenBSD: README,v 1.5 2018/09/04 12:46:24 espie Exp $
2
3+-----------------------------------------------------------------------
4| Running ${PKGSTEM} on OpenBSD
5+-----------------------------------------------------------------------
6
7Cgit config
8===========
9By default, the cgitrc config file is searched in ${PREFIX}/conf/cgitrc.
10Refer to cgitrc(5) for the syntax.
11
12Webserver config
13================
14
15OpenBSD httpd
16-------------
17server "default" {
18 listen on egress port 80
19
20 # don't serve static files from cgit CGI: cgit.css and cgit.png
21 location "/cgit.*" {
22 root "/cgit"
23 no fastcgi
24 }
25 root "/cgi-bin/cgit.cgi"
26 fastcgi socket "/run/slowcgi.sock"
27}
28
29Nginx
30-----
31An example nginx config snippet is provided below, to run with
32slowcgi:
33
34server {
35 server_name cgit.example.com;
36 access_log logs/cgit-access main;
37 error_log logs/cgit-error warn;
38 location ~ /cgit.(png|css) {
39 root /var/www/htdocs;
40 }
41 location / {
42 rewrite /(.*) /cgi-bin/cgit.cgi/$1;
43 }
44 location /cgi-bin/ {
45 fastcgi_pass unix:run/slowcgi.sock;
46 fastcgi_split_path_info ^(/cgi-bin/[^/]+)(.*);
47 fastcgi_param PATH_INFO $fastcgi_path_info;
48 include fastcgi_params;
49 }
50}
51
52Apache config
53-------------
54
55This config snippet works with Apache:
56
57ScriptAlias /cgit /cgi-bin/cgit.cgi
58<Location "/cgit">
59 AllowOverride None
60 Options +ExecCGI
61 Order allow,deny
62 Allow from all
63</Location>
64
65
66snapshots
67---------
68Nginx and OpenBSD httpd use chroot(2).
69
70For .tar.gz snapshot support a static binary in $chroot/bin/gzip is required.
71
72 cd /usr/src/usr.bin/compress
73 make clean && make LDFLAGS="-static -pie"
74 cp obj/compress $chroot/bin/gzip