summaryrefslogtreecommitdiffstats
path: root/development/cgit/config/cgit-httpd.conf
blob: 4b757ea04961c4960f288daf3d821652139d3bbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Sample folder and virtual host configurations for httpd.
# edit, move it to /etc/httpd/extra and include it in
# /etc/httpd/httpd.conf with a line
#
# Include /etc/httpd/extra/cgit.conf
#
# uncomment also the line
#
# AddHandler cgi-script .cgi
#
# and enable mod_cgi (or mod_cgid, depending on your apache
# configuration)

## Version 1: cgit in a /cgit subdirectory of the main host
## This will need the following 3 lines in your /etc/cgitrc
##
## virtual-root=/cgit/
## css=/static/cgit.css
## logo=/static/cgit.png
##
#Alias /static/cgit.css "@DOCROOT@/cgi-bin/cgit.css"
#Alias /static/cgit.png "@DOCROOT@/cgi-bin/cgit.png"
#ScriptAlias /cgit/ "@DOCROOT@/cgi-bin/cgit.cgi/"
#RedirectMatch ^/cgit$ /cgit/
#<Directory "@DOCROOT@/cgi-bin/">
#   AllowOverride None
#   Options ExecCGI FollowSymlinks
#   Require all granted
#</Directory>

# Version 2: cgit as a handler to whole vhost
# Thanks to Robby Workman for this elegant example
<VirtualHost *:80>
     ServerName cgit.yourdomain.ltd
     
     Options FollowSymlinks

     SetEnv CGIT_CONFIG /etc/cgitrc

     DocumentRoot @DOCROOT@/cgi-bin

     <Directory @DOCROOT@/cgi-bin>
          AllowOverride None
          Require all granted
          DirectoryIndex cgit.cgi
     </Directory>

     Alias /cgit.css @DOCROOT@/cgi-bin/cgit.css
     Alias /cgit.png @DOCROOT@/cgi-bin/cgit.png
     Alias /favicon.ico @DOCROOT@/cgi-bin/favicon.ico
     Alias /robots.txt @DOCROOT@/cgi-bin/robots.txt
     Alias / @DOCROOT@/cgi-bin/cgit.cgi/

     <Location />
          Options ExecCGI
          Require all granted
     </Location>

     <Files cgit.cgi>
          SetHandler cgi-script
     </Files>
</VirtualHost>