summaryrefslogtreecommitdiff
path: root/apache2/conf.d
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-02-03 14:35:47 +0100
committerJonas Smedegaard <dr@jones.dk>2015-02-03 14:35:47 +0100
commit16d8f44e6f1212879d83b30de268399c0858c7ff (patch)
tree34fe1669c583b19cc6b90e8acb1c1bf0ee09001b /apache2/conf.d
parentb82a0fe8ec16fce12a7f5085d8217238b7801fee (diff)
Add Apache 2.2 style cgit snippet.
Diffstat (limited to 'apache2/conf.d')
-rw-r--r--apache2/conf.d/local-cgit.conf34
1 files changed, 34 insertions, 0 deletions
diff --git a/apache2/conf.d/local-cgit.conf b/apache2/conf.d/local-cgit.conf
new file mode 100644
index 0000000..ee291e2
--- /dev/null
+++ b/apache2/conf.d/local-cgit.conf
@@ -0,0 +1,34 @@
+AddDefaultCharset UTF-8
+
+<Directory /srv/git>
+ Options None
+ AllowOverride None
+ Order allow,deny
+ allow from all
+</Directory>
+
+<Directory /usr/lib/cgit>
+ Options ExecCgi FollowSymLinks
+ AllowOverride None
+ Order allow,deny
+ allow from all
+<</Directory>
+
+
+<Directory /usr/share/cgit>
+ Options None
+ AllowOverride None
+ Order allow,deny
+ allow from all
+<</Directory>
+
+RewriteEngine on
+
+RewriteRule ^/(cgit-css/)?(cgit\.(css|png)|favicon\.ico|robots.txt)$ /usr/share/cgit/$2 [last]
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule "^(.*)/(.*)/(HEAD|info/refs|objects/(info/[^/]+|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(pack|idx))|git-(upload|receive)-pack)$" /usr/lib/git-core/git-http-backend/$1.git/$2 [NS,L,QSA]
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(/.*)?$ /usr/lib/cgit/cgit.cgi$1 [T=application/x-httpd-cgi,L,NS]