summaryrefslogtreecommitdiff
path: root/lighttpd.conf
diff options
context:
space:
mode:
Diffstat (limited to 'lighttpd.conf')
-rw-r--r--lighttpd.conf45
1 files changed, 45 insertions, 0 deletions
diff --git a/lighttpd.conf b/lighttpd.conf
new file mode 100644
index 0000000..3d546dc
--- /dev/null
+++ b/lighttpd.conf
@@ -0,0 +1,45 @@
+server.modules = (
+ "mod_rewrite",
+ "mod_alias",
+ "mod_access",
+ "mod_setenv",
+ "mod_cgi",
+ "mod_accesslog"
+)
+
+include "mime-types.conf"
+
+server.username = "lighttpd"
+server.groupname = "lighttpd"
+server.pid-file = "/run/lighttpd.pid"
+server.document-root = "/usr/share/gitweb/"
+static-file.exclude-extensions = ( ".cgi" )
+
+$HTTP["url"] !~ "^/static" { # gitweb assets (js, css, png)
+
+ dir-listing.activate = "disable"
+ cgi.assign = ( ".cgi" => "" )
+ $HTTP["url"] =~ "^/.*/(HEAD|info/refs|objects/info/|git-(upload|receive)-pack)" { # git over http
+ cgi.assign = ("" => "")
+ alias.url += ( "/" => "/usr/libexec/git-core/git-http-backend/" )
+ setenv.add-environment = (
+ "GIT_PROJECT_ROOT" => "/var/git",
+ "GIT_HTTP_EXPORT_ALL" => ""
+ )
+ }
+ else $HTTP["url"] =~ "^/(?!gitweb.cgi)" { # gitweb
+ server.indexfiles = ( "gitweb.cgi" )
+ alias.url += ( "/" => "/usr/share/gitweb/" )
+ url.rewrite-once = ( "^/(.*)" => "/gitweb.cgi/$1" )
+ }
+}
+
+setenv.add-environment = (
+ "GITWEB_CONFIG" => "/etc/gitweb.conf",
+ "PATH" => env.PATH
+)
+
+#debug.log-request-header = "enable"
+#debug.log-response-header = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found = "enable"