README 1.6 KB

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