cgit-httpd.conf (1669B)
1 # Sample folder and virtual host configurations for httpd. 2 # edit, move it to /etc/httpd/extra and include it in 3 # /etc/httpd/httpd.conf with a line 4 # 5 # Include /etc/httpd/extra/cgit.conf 6 # 7 # uncomment also the line 8 # 9 # AddHandler cgi-script .cgi 10 # 11 # and enable mod_cgi (or mod_cgid, depending on your apache 12 # configuration) 13 14 ## Version 1: cgit in a /cgit subdirectory of the main host 15 ## This will need the following 3 lines in your /etc/cgitrc 16 ## 17 ## virtual-root=/cgit/ 18 ## css=/static/cgit.css 19 ## logo=/static/cgit.png 20 ## 21 #Alias /static/cgit.css "@DOCROOT@/cgi-bin/cgit.css" 22 #Alias /static/cgit.png "@DOCROOT@/cgi-bin/cgit.png" 23 #ScriptAlias /cgit/ "@DOCROOT@/cgi-bin/cgit.cgi/" 24 #RedirectMatch ^/cgit$ /cgit/ 25 #<Directory "@DOCROOT@/cgi-bin/"> 26 # AllowOverride None 27 # Options ExecCGI FollowSymlinks 28 # Require all granted 29 #</Directory> 30 31 # Version 2: cgit as a handler to whole vhost 32 # Thanks to Robby Workman for this elegant example 33 <VirtualHost *:80> 34 ServerName cgit.yourdomain.ltd 35 36 Options FollowSymlinks 37 38 SetEnv CGIT_CONFIG /etc/cgitrc 39 40 DocumentRoot @DOCROOT@/cgi-bin 41 42 <Directory @DOCROOT@/cgi-bin> 43 AllowOverride None 44 Require all granted 45 DirectoryIndex cgit.cgi 46 </Directory> 47 48 Alias /cgit.css @DOCROOT@/cgi-bin/cgit.css 49 Alias /cgit.png @DOCROOT@/cgi-bin/cgit.png 50 Alias /favicon.ico @DOCROOT@/cgi-bin/favicon.ico 51 Alias /robots.txt @DOCROOT@/cgi-bin/robots.txt 52 Alias / @DOCROOT@/cgi-bin/cgit.cgi/ 53 54 <Location /> 55 Options ExecCGI 56 Require all granted 57 </Location> 58 59 <Files cgit.cgi> 60 SetHandler cgi-script 61 </Files> 62 </VirtualHost>